Ejemplo n.º 1
0
 def test_Equal(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(1)
     out = ts.Equal(t, c)
     assert ts.run(out) == [True, False]
Ejemplo n.º 2
0
 def test_Mod(self):
     t = ts.Timer(func, count=5)
     c = ts.Const(3)
     out = ts.Mod(t, c)
     assert ts.run(out) == [1, 2, 0, 1, 2]
Ejemplo n.º 3
0
 def test_Sum(self):
     t = ts.Timer(func, count=2)
     t2 = ts.Timer(func, count=2)
     c = ts.Const(2)
     out = ts.Sum(t, t2, c)
     assert ts.run(out) == [4, 6]
Ejemplo n.º 4
0
 def test_Add(self):
     t = ts.Timer(func, count=2)
     out = ts.Add(t, t)
     assert ts.run(out) == [2, 4]
Ejemplo n.º 5
0
 def test_Mult(self):
     t = ts.Timer(func, count=2)
     out = ts.Mult(t, t)
     assert ts.run(out) == [1, 4]
Ejemplo n.º 6
0
 def test_Str(self):
     t = ts.Timer(func, count=2)
     out = ts.Str(t)
     assert ts.run(out) == ["1", "2"]
Ejemplo n.º 7
0
 def test_Negate(self):
     t = ts.Timer(func, count=2)
     out = ts.Negate(t)
     assert ts.run(out) == [-1, -2]
Ejemplo n.º 8
0
 def test_Cos(self):
     t = ts.Timer(func, count=2)
     out = ts.Cos(t)
     assert ts.run(out) == [math.cos(1), math.cos(2)]
Ejemplo n.º 9
0
 def test_Arccos(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(value=3)
     out = ts.Arccos(ts.Div(t, c))
     assert ts.run(out) == [math.acos(1 / 3), math.acos(2 / 3)]
Ejemplo n.º 10
0
 def test_Log(self):
     t = ts.Timer(func, count=2)
     out = ts.Log(t)
     assert ts.run(out) == [math.log(1), math.log(2)]
Ejemplo n.º 11
0
 def test_Sin(self):
     t = ts.Timer(func, count=2)
     out = ts.Sin(t)
     assert ts.run(out) == [math.sin(1), math.sin(2)]
Ejemplo n.º 12
0
 def test_Ge(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(2)
     out = ts.Ge(t, c)
     assert ts.run(out) == [False, True]
Ejemplo n.º 13
0
 def test_Le(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(2)
     out = ts.Le(c, t)
     assert ts.run(out) == [False, True]
Ejemplo n.º 14
0
 def test_NotEqual(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(1)
     out = ts.NotEqual(t, c)
     assert ts.run(out) == [False, True]
Ejemplo n.º 15
0
 def test_Float(self):
     t = ts.Timer(func, count=2)
     out = ts.Float(t)
     assert ts.run(out) == [1.0, 2.0]
Ejemplo n.º 16
0
 def test_Arctan(self):
     t = ts.Timer(func, count=2)
     out = ts.Arctan(t)
     assert ts.run(out) == [math.atan(1), math.atan(2)]
Ejemplo n.º 17
0
 def test_Bool(self):
     t = ts.Timer(func, count=2)
     out = ts.Bool(t)
     assert ts.run(out) == [True, True]
Ejemplo n.º 18
0
 def test_Sqrt(self):
     t = ts.Timer(func2, count=3)
     out = ts.Sqrt(t)
     assert ts.run(out) == [1.0, 2.0, 3.0]
Ejemplo n.º 19
0
 def test_Noop(self):
     t = ts.Timer(func, count=2)
     out = ts.Noop(t)
     assert ts.run(out) == [1, 2]
Ejemplo n.º 20
0
 def test_Abs(self):
     t = ts.Timer(func3, count=2)
     out = ts.Abs(t)
     assert ts.run(out) == [1, 2]
Ejemplo n.º 21
0
 def test_Invert(self):
     t = ts.Timer(func, count=2)
     out = ts.Invert(t)
     assert ts.run(out) == [1 / 1, 1 / 2]
Ejemplo n.º 22
0
 def test_Exp(self):
     t = ts.Timer(func, count=2)
     out = ts.Exp(t)
     assert ts.run(out) == [math.exp(1), math.exp(2)]
Ejemplo n.º 23
0
 def test_Sub(self):
     t = ts.Timer(func, count=2)
     out = ts.Sub(t, t)
     assert ts.run(out) == [0, 0]
Ejemplo n.º 24
0
 def test_Erf(self):
     t = ts.Timer(func, count=2)
     out = ts.Erf(t)
     assert ts.run(out) == [math.erf(1), math.erf(2)]
Ejemplo n.º 25
0
 def test_RDiv(self):
     t = ts.Timer(func, count=2)
     out = ts.RDiv(t, t)
     assert ts.run(out) == [1, 1]
Ejemplo n.º 26
0
 def test_Ceil(self):
     t = ts.Timer(funcfloat, count=2)
     out = ts.Ceil(t)
     assert ts.run(out) == [2.0, 3.0]
Ejemplo n.º 27
0
 def test_Pow(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(2)
     out = ts.Pow(t, c)
     assert ts.run(out) == [1, 4]
Ejemplo n.º 28
0
 def test_Round(self):
     t = ts.Timer(funcfloat, count=2)
     out = ts.Round(t, 1)
     assert ts.run(out) == [1.1, 2.2]
Ejemplo n.º 29
0
 def test_Average(self):
     t = ts.Timer(func, count=1)
     t2 = ts.Timer(func, count=1)
     c = ts.Const(1)
     out = ts.Average(t, t2, c)
     assert ts.run(out) == [1]
Ejemplo n.º 30
0
 def test_Or(self):
     t = ts.Timer(func, count=2)
     out = ts.Or(t, t)
     assert ts.run(out) == [1, 2]