Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (26 sloc) 1.015 kB
a13b22a @vincentisambart splitted test_roxor.rb in multiple files
vincentisambart authored
1 assert '""', "s=''; p s"
2 assert '"foo"', "s='foo'; p s"
3
4 assert "[]", "a=[]; p a"
5 assert "[1, 2, 3]", "a=[1,2,3]; p a"
6 assert 'nil', "a=[]; p a[42]"
7
8 assert "{}", "h={}; p h"
199ffae @vincentisambart added tests for using a keyword as a key in a hash
vincentisambart authored
9 assert "{:in=>42}", "h={in: 42}; p h"
a13b22a @vincentisambart splitted test_roxor.rb in multiple files
vincentisambart authored
10 assert "3", "h={:un=>1,:deux=>2}; p h[:un]+h[:deux]"
11
12 assert '"foo246bar"', "p \"foo#{1+1}#{2+2}#{3+3}bar\""
13
14 assert ":ok", 'p :ok'
15 assert ":ok", 'p :"ok"'
16 assert ":ok", 'p :"#{:ok}"'
17 assert ":\"42\"", 'p :"#{40+2}"'
18 assert ":foo42", 'p :"foo#{40+2}"'
3bc1b28 @alloy Added failing test case for equality of arrays with strings/symbols.
alloy authored
19
9bc892f inline Symbols
Laurent Sansonetti authored
20 assert 'true', "p :foo == :foo"
21 assert 'true', "p :foo === :foo"
22 assert 'true', "p :foo != :bar"
23 assert 'false', "p :foo == :bar"
24 assert 'false', "p :foo === :bar"
25 assert 'false', "p :foo != :foo"
26
27 assert '42', "class Symbol; def ==(o); p 42; end; end; :foo == :foo"
28 assert '42', "class Symbol; def ===(o); p 42; end; end; :foo === :foo"
29 assert '42', "class Symbol; def !=(o); p 42; end; end; :foo != :foo"
30
31 assert "false", "p ['foo'] == [:foo]"
913687b fixed a bug in the way we compile literal strings
Laurent Sansonetti authored
32
33 assert '424242', "a=''; 3.times { b=''; b << '42'; a<<b }; p a.to_i"
3b36a1a @alloy Added failing tests for defined?(yield) and literal lambda "->".
alloy authored
34
199ffae @vincentisambart added tests for using a keyword as a key in a hash
vincentisambart authored
35 assert '42', 'p -> { 42 }.call'
Something went wrong with that request. Please try again.