hbui
2024-07-23 0ef74701598a73c00851b572c661ce69d10d79ce
fix unittest for old syntax
2 files renamed
6 ■■■■ changed files
num-int/tests/numint/expression_test.py 6 ●●●● patch | view | raw | blame | history
stundenplan/tests/pygraph/graphdemo_tests.py patch | view | raw | blame | history
num-int/tests/numint/expression_test.py
File was renamed from num-int/tests/numint/ExpressionTest.py
@@ -9,17 +9,17 @@
    def test_prio_product_exponent(self):
        parser = Lark_StandAlone()
        tree = parser.parse("x ^ -3 * sin(12)")  # => (x^3) * sin(12)
        tree = parser.parse("x ** -3 * sin(12)")  # => (x^3) * sin(12)
        print(tree.pretty())
    def test_prio_product_exponent_revert(self):
        parser = Lark_StandAlone()
        tree = parser.parse("sin(12) * x ^ sqrt(4)")  # => sin(12) * (x^sqrt(4))
        tree = parser.parse("sin(12) * x ** sqrt(4)")  # => sin(12) * (x ** sqrt(4))
        print(tree.pretty())
    def test_use_transform(self):
        parser = Lark_StandAlone(transformer=ExpressionTransformer())
        tree = parser.parse("log(-12, 5) * x ^ sqrt(4)")  # => sin(12) * (x^sqrt(4))
        tree = parser.parse("log(-12, 5) * x ** sqrt(4)")  # => sin(12) * (x^sqrt(4))
        self.assertEqual(tree, 'math.log(-12, 5) * x ** math.sqrt(4)')
        print(tree)
stundenplan/tests/pygraph/graphdemo_tests.py