Ejemplo n.º 1
0
 def test_expand_crazy_quote_combo(self):
     source = "`(this ,,'`(makes ,no) 'sense)"
     assert_equals(source, unparse(parse(source)))
Ejemplo n.º 2
0
 def test_expand_quoted_symbol_dont_touch_nested_quote_on_list(self):
     source = "(foo ''(bar))"
     assert_equals(source, unparse(parse(source)))
Ejemplo n.º 3
0
 def test_unparse_quasiquotes_with_unquote(self):
     ast = ["quote", ["quasiquote", ["foo", ["unquote", "bar"]]]]
     assert_equals("'`(foo ,bar)", unparse(ast))
Ejemplo n.º 4
0
 def test_unparse_empty_list(self):
     assert_equals("()", unparse([]))
Ejemplo n.º 5
0
 def test_unparse_quotes(self):
     assert_equals("'foo", unparse(["quote", "foo"]))
     assert_equals("'(1 2 3)", 
         unparse(["quote", [integer(1), integer(2), integer(3)]]))
Ejemplo n.º 6
0
 def test_unparse_list(self):
     assert_equals("(1 2 3)", unparse([integer(1), integer(2), integer(3)]))
     assert_equals("(if #t 42 #f)",
         unparse(["if", boolean(True), integer(42), boolean(False)]))
Ejemplo n.º 7
0
 def test_unparse_symbol(self):
     assert_equals("+", unparse("+"))
     assert_equals("foo", unparse("foo"))
     assert_equals("lambda", unparse("lambda"))
Ejemplo n.º 8
0
 def test_unparse_int(self):
     assert_equals("1", unparse(integer(1)))
     assert_equals("1337", unparse(integer(1337)))
     assert_equals("-42", unparse(integer(-42)))
Ejemplo n.º 9
0
 def test_unparse_bool(self):
     assert_equals("#t", unparse(boolean(True)))
     assert_equals("#f", unparse(boolean(False)))