diff options
-rw-r--r-- | 18.py | 13 |
1 files changed, 0 insertions, 13 deletions
@@ -50,19 +50,6 @@ def try_explode(n, depth=0): else: return Pair(try_add(n, val.car, car, cdr, car), val.cdr) -tests = [ - ('[[[[[9,8],1],2],3],4]', '[[[[0,9],2],3],4]'), - ('[7,[6,[5,[4,[3,2]]]]]', '[7,[6,[5,[7,0]]]]'), - ('[[6,[5,[4,[3,2]]]],1]', '[[6,[5,[7,0]]],3]'), - ('[[3,[2,[1,[7,3]]]],[6,[5,[4,[3,2]]]]]', '[[3,[2,[8,0]]],[9,[5,[4,[3,2]]]]]'), - ('[[3,[2,[8,0]]],[9,[5,[4,[3,2]]]]]', '[[3,[2,[8,0]]],[9,[5,[7,0]]]]'), -] - -for test, expect in tests: - test = parse(test) - try_explode(test) - assert(test == parse(expect)) - def try_split(n, access=lambda n: n): content = access(n) if is_pair(content): |