sexpistol 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -122,10 +122,16 @@ class Sexpistol
122
122
  if( item.is_a?(Array))
123
123
  to_sexp(item)
124
124
  else
125
- item.to_s
125
+ if(item === false)
126
+ "#f"
127
+ elsif(item === true)
128
+ "#t"
129
+ else
130
+ item.to_s
131
+ end
126
132
  end
127
133
  end
128
- "( " + mapped.join(" ") + " )"
134
+ "(" + mapped.join(" ") + ")"
129
135
  end
130
136
 
131
137
  private
data/sexpistol.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sexpistol}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Gough"]
@@ -9,7 +9,19 @@ class ToSexpTest < Test::Unit::TestCase
9
9
  test "should convert nested arrays back into an S-Expression" do
10
10
  ast = [:string, [:is, [:parsed]]]
11
11
  sexp = @parser.to_sexp(ast)
12
- assert_equal "( string ( is ( parsed ) ) )", sexp
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 output true and false using scheme notation" do
22
+ ast = [true, [false, [true, false]]]
23
+ sexp = @parser.to_sexp(ast)
24
+ assert_equal "(#t (#f (#t #f)))", sexp
13
25
  end
14
26
 
15
27
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Aaron Gough