Example #1
0
 def test_function_call(self):
     trace(sum([sum([1, 2, 3]), min(4, 5, 6), max(7, 8, 9)]))
     assert (result[-5:] == [
         "sum([1, 2, 3]) -> 6", "min(4, 5, 6) -> 4", "max(7, 8, 9) -> 9",
         "[sum([1, 2, 3]), min(4, 5, 6), max(7, 8, 9)] -> [6, 4, 9]",
         "sum([sum([1, 2, 3]), min(4, 5, 6), max(7, 8, 9)]) -> 19"
     ])
Example #2
0
    def test_combo(self):

        trace(1 + 2 + 3 + 4)

        assert (result[-3:] == [
            "1 + 2 -> 3", "1 + 2 + 3 -> 6", "1 + 2 + 3 + 4 -> 10"
        ])
Example #3
0
 def test_function_call(self):
     trace(sum([sum([1, 2, 3]), min(4, 5, 6), max(7, 8, 9)]))
     assert(result[-5:] == [
         "sum([1, 2, 3]) -> 6",
         "min(4, 5, 6) -> 4",
         "max(7, 8, 9) -> 9",
         "[sum([1, 2, 3]), min(4, 5, 6), max(7, 8, 9)] -> [6, 4, 9]",
         "sum([sum([1, 2, 3]), min(4, 5, 6), max(7, 8, 9)]) -> 19"
     ])
Example #4
0
        def test_combo(self):

            trace(1 + 2 + 3 + 4)

            assert(result[-3:] == [
                "1 + 2 -> 3",
                "1 + 2 + 3 -> 6",
                "1 + 2 + 3 + 4 -> 10"
            ])
Example #5
0
    def test_fancy(self):
        trace([
            len(x) * 3 for x in ['omg', 'wtf', 'b' * 2 + 'q', 'lo' * 3 + 'l']
        ])

        assert (result[-14:] == [
            "'b' * 2 -> 'bb'", "'b' * 2 + 'q' -> 'bbq'",
            "'lo' * 3 -> 'lololo'", "'lo' * 3 + 'l' -> 'lololol'",
            "['omg', 'wtf', 'b' * 2 + 'q', 'lo' * 3 + 'l'] -> ['omg', 'wtf', 'bbq', 'lololol']",
            "len(x) -> 3", "len(x)*3 -> 9", "len(x) -> 3", "len(x)*3 -> 9",
            "len(x) -> 3", "len(x)*3 -> 9", "len(x) -> 7", "len(x)*3 -> 21",
            "[len(x)*3 for x in ['omg', 'wtf', 'b' * 2 + 'q', 'lo' * 3 + 'l']] -> [9, 9, 9, 21]"
        ])
Example #6
0
        def test_fancy(self):
            trace([len(x)*3 for x in ['omg', 'wtf', 'b' * 2 + 'q', 'lo' * 3 + 'l']])

            assert(result[-14:] == [
                "'b' * 2 -> 'bb'",
                "'b' * 2 + 'q' -> 'bbq'",
                "'lo' * 3 -> 'lololo'",
                "'lo' * 3 + 'l' -> 'lololol'",
                "['omg', 'wtf', 'b' * 2 + 'q', 'lo' * 3 + 'l'] -> ['omg', 'wtf', 'bbq', 'lololol']",
                "len(x) -> 3",
                "len(x)*3 -> 9",
                "len(x) -> 3",
                "len(x)*3 -> 9",
                "len(x) -> 3",
                "len(x)*3 -> 9",
                "len(x) -> 7",
                "len(x)*3 -> 21",
                "[len(x)*3 for x in ['omg', 'wtf', 'b' * 2 + 'q', 'lo' * 3 + 'l']] -> [9, 9, 9, 21]"
            ])