Skip to content

Commit c14e4fc

Browse files
committed
Update fixtures to work with rbs 3 and 4
1 parent 917c416 commit c14e4fc

6 files changed

Lines changed: 26 additions & 16 deletions

File tree

test/js/rbs/combination.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
untyped | void | nil
2-
untyped & void & nil
3-
untyped | void & nil
4-
untyped & void | nil
5-
untyped & (void | nil)
1+
untyped | bool | nil
2+
untyped & bool & nil
3+
untyped | bool & nil
4+
untyped & bool | nil
5+
untyped & (bool | nil)

test/js/rbs/optional.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
untyped?
22
^-> untyped?
3-
untyped | void?
3+
untyped | bool?
44
:foo??
55
:foo!?

test/js/rbs/plain.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
void
21
untyped
32
bool
43
true
54
false
65
nil
76
top
87
bot
9-
self
10-
instance
11-
class

test/js/rbs/proc.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
^-> void
22
^(untyped) -> void
3-
^(untyped, void) -> void
4-
^(untyped x, void _y) -> void
5-
^(untyped x, ?void, ?nil y) -> void
6-
^(untyped x, ?void, ?nil y, *untyped a) -> void
3+
^(untyped, bool) -> void
4+
^(untyped x, bool _y) -> void
5+
^(untyped x, ?bool, ?nil y) -> void
6+
^(untyped x, ?bool, ?nil y, *untyped a) -> void
77
^(untyped x, *untyped a, nil z) -> void
88
^(foo: untyped, _bar: nil bar) -> void
99
^(?_bar: nil, **untyped rest) -> void

test/js/rbs/rbs.test.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,21 @@ describe("rbs", () => {
283283
});
284284
});
285285

286-
describeCases("plain", (source) => `T: ${source}`);
286+
describe("plain", () => {
287+
testCases("plain", (source) => `T: ${source}`);
288+
289+
["void", "self", "instance", "class"].forEach((source) => {
290+
test(source, () => {
291+
const content = rbs(`
292+
class T
293+
def t: -> ${source}
294+
end
295+
`);
296+
297+
return expect(content).toMatchFormat();
298+
});
299+
});
300+
});
287301

288302
describe("proc", () => {
289303
testCases("proc", (source) => `T: ${source}`);

test/js/rbs/tuple.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[ ]
2-
[untyped, nil, void]
2+
[untyped, nil, bool]
33
[untyped]

0 commit comments

Comments
 (0)