sexpistol 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,51 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper.rb'))
2
-
3
- class ToSexpTest < Test::Unit::TestCase
4
-
5
- def setup
6
- @parser = Sexpistol.new
7
- end
8
-
9
- test "should convert nested arrays back into an S-Expression" do
10
- ast = [:string, [:is, [:parsed]]]
11
- sexp = @parser.to_sexp(ast)
12
- assert_equal "(string (is (parsed)))", sexp
13
- end
14
-
15
- test "should structure containing integers and strings back into an S-Expression" do
16
- ast = ["String!", [1, [2, "Other string."]]]
17
- sexp = @parser.to_sexp(ast)
18
- assert_equal "(String! (1 (2 Other string.)))", sexp
19
- end
20
-
21
- test "should not output true and false using scheme notation when scheme compat is off" do
22
- ast = [true, [false, [true, false]]]
23
- sexp = @parser.to_sexp(ast)
24
- assert_equal "(true (false (true false)))", sexp
25
- end
26
-
27
- test "when not passed array to_sexp should print value (integer)" do
28
- ast = 1
29
- sexp = @parser.to_sexp(ast)
30
- assert_equal "1", sexp
31
- end
32
-
33
- test "when not passed array to_sexp should print value (string)" do
34
- ast = "test"
35
- sexp = @parser.to_sexp(ast)
36
- assert_equal "test", sexp
37
- end
38
-
39
- test "when not passed array to_sexp should print value (symbol)" do
40
- ast = :test
41
- sexp = @parser.to_sexp(ast)
42
- assert_equal "test", sexp
43
- end
44
-
45
- test "lists passed to to_sexp should have not extraneous spaces" do
46
- ast = [1, 2, 3]
47
- sexp = @parser.to_sexp(ast)
48
- assert_equal "(1 2 3)", sexp
49
- end
50
-
51
- end