MilesCranmer commited on
Commit
a55fec0
1 Parent(s): 35ca811

Add tests of index selection

Browse files
Files changed (1) hide show
  1. test/test.py +6 -0
test/test.py CHANGED
@@ -203,6 +203,12 @@ class TestBest(unittest.TestCase):
203
 
204
  def test_best(self):
205
  self.assertEqual(self.model.sympy(), sympy.cos(sympy.Symbol("x0")) ** 2)
 
 
 
 
 
 
206
 
207
  def test_best_tex(self):
208
  self.assertEqual(self.model.latex(), "\\cos^{2}{\\left(x_{0} \\right)}")
 
203
 
204
  def test_best(self):
205
  self.assertEqual(self.model.sympy(), sympy.cos(sympy.Symbol("x0")) ** 2)
206
+
207
+ def test_index_selection(self):
208
+ self.assertEqual(self.model.sympy(-1), sympy.cos(sympy.Symbol("x0")) ** 2)
209
+ self.assertEqual(self.model.sympy(2), sympy.cos(sympy.Symbol("x0")) ** 2)
210
+ self.assertEqual(self.model.sympy(1), sympy.cos(sympy.Symbol("x0")))
211
+ self.assertEqual(self.model.sympy(0), 1.0)
212
 
213
  def test_best_tex(self):
214
  self.assertEqual(self.model.latex(), "\\cos^{2}{\\left(x_{0} \\right)}")