-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc19817
commit c2f4753
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export module fs.nu | ||
export module record.nu | ||
export module recurse.nu | ||
export module str_xpend.nu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use std assert | ||
use ../std-rfc recurse | ||
|
||
const fixture = [ | ||
0 | ||
{ a: 1 } | ||
{ | ||
b: [ | ||
2 | ||
[ | ||
[c d]; | ||
[3 4] | ||
] | ||
] | ||
} | ||
] | ||
|
||
export def test [] { | ||
assert equal ($fixture | recurse) [ | ||
$fixture # [0, {a: 1}, {b: [2, [[c, d]; [3, 4]]]}] | ||
$fixture.0 # 0 | ||
$fixture.1 # {a: 1} | ||
$fixture.1.a # 1 | ||
$fixture.2 # {b: [2, [[c, d]; [3, 4]]]} | ||
$fixture.2.b # [2, [[c, d]; [3, 4]]] | ||
$fixture.2.b.0 # 2 | ||
$fixture.2.b.1 # [c, d]; [3, 4]] | ||
$fixture.2.b.1.0 # {c: 3, d: 4} | ||
$fixture.2.b.1.0.c # 3 | ||
$fixture.2.b.1.0.d # 4 | ||
] | ||
} |