Skip to content

Commit 3cab7b7

Browse files
committed
tidied rubb^Hyish tests
1 parent 901a922 commit 3cab7b7

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed
File renamed without changes.

examples/rubyish/t/line-spanning.t

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
puts "1..11"
1+
puts "1..13"
22

33
a=[10,
44
20]
@@ -62,5 +62,6 @@ ok #{tst += 1} - heredoc interpolating line 2
6262
THE_END
6363
puts theredoc
6464
65-
66-
65+
print "ok 12 - multi-line string line 1
66+
ok 13 - multi-line string line 2
67+
"

examples/rubyish/t/scoping.t

100644100755
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
puts "1..12"
1+
puts "1..13"
22

3-
$a = "ok 1"
4-
a = "ok 2"
5-
b = "ok 3"
3+
a = "ok 1"
4+
b = "ok 2"
5+
$a = "ok 3"
66
$c = "nok 4"
77

88
def some_sub
9-
b = "nok 3"
9+
b = "nok 2"
1010
$c = "ok 4"
1111
$d = "ok 5"
1212
end
1313
some_sub()
1414

1515
class MyClass
16-
@@final_test = 12
17-
a = 'wtf'
16+
@@final_test = 13
1817

1918
def set_class(v); @@c = v; b = 'wtf'; end
2019
def get_class; @@c; end
2120
def set_inst(v); @i = v; end
2221
def get_inst; @i; end
2322
def class_const; @@final_test ; end
23+
def tickle_f(f); @f = f ; end
2424

2525
end
2626

@@ -33,25 +33,28 @@ obj1 = MyClass.new;
3333
obj2 = MyClass.new;
3434
obj3 = OtherClass.new;
3535

36-
puts "#{$a} - $a (global)"
37-
puts "#{a} - a (local)"
38-
puts "#{b} - b (local)"
39-
puts "#{$c} - $c (global)"
40-
puts "#{$d} - $d (global)"
36+
obj1.set_class(8)
37+
obj3.set_class(10)
4138

42-
@e=6
43-
puts "ok #{@e} - @gobal"
39+
puts "#{a} - local: main"
40+
puts "#{b} - local: main, function"
41+
puts "#{$a} - $global: main"
42+
puts "#{$c} - $global: main, function"
43+
puts "#{$d} - $global: function"
4444

45-
obj1.set_class(7)
46-
obj3.set_class(9)
45+
@e=6
46+
@f='ok'
47+
obj1.tickle_f('nok')
48+
puts "ok #{@e} - @instance: main"
49+
puts "#{@f} 7 - @instance: main, object"
4750

48-
puts "ok #{obj1.get_class} - class access"
49-
puts "ok #{obj2.get_class() + 1} - class access"
50-
puts "ok #{obj3.get_class} - class variable"
51+
puts "ok #{obj1.get_class} - @@class access"
52+
puts "ok #{obj2.get_class() + 1} - @@class access"
53+
puts "ok #{obj3.get_class} - @@class variable"
5154

52-
obj1.set_inst(10)
53-
obj2.set_inst(11)
55+
obj1.set_inst(11)
56+
obj2.set_inst(12)
5457

55-
puts "ok #{obj1.get_inst} - instance access"
56-
puts "ok #{obj2.get_inst} - instance access"
57-
puts "ok #{obj2.class_const} - class constant"
58+
puts "ok #{obj1.get_inst} - @instance access"
59+
puts "ok #{obj2.get_inst} - @instance access"
60+
puts "ok #{obj2.class_const} - @@class constant"

0 commit comments

Comments
 (0)