-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nupm test --dir stdlib-candidate
- Loading branch information
1 parent
872a123
commit 65aa7cc
Showing
5 changed files
with
35 additions
and
35 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
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
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,3 @@ | ||
export module fs.nu | ||
export module record.nu | ||
export module str.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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
#[test] | ||
def test_record_list_merge [] { | ||
use std assert | ||
assert equal ([{a:1} {b:2} {c:3} {d:4}] | list merge) {a:1 b:2 c:3 d:4} | ||
use std assert | ||
use ../std-rfc record | ||
|
||
export def "list_merge" [] { | ||
assert equal ([{a:1} {b:2} {c:3} {d:4}] | record list merge) {a:1 b:2 c:3 d:4} | ||
} | ||
#[test] | ||
def test_record_filtername_predicate [] { | ||
use std assert | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | filter-name predicate {$in | str contains a}) {aa:1 ab:2 ba:3 ca:5} | ||
|
||
export def "filter-name predicate" [] { | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | record filter-name predicate {$in | str contains a}) {aa:1 ab:2 ba:3 ca:5} | ||
} | ||
#[test] | ||
def test_record_filtername_text [] { | ||
use std assert | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | filter-name text a) {aa:1 ab:2 ba:3 ca:5} | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | filter-name text -r ^a) {aa:1 ab:2} | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | filter-name text -r ^A) {} | ||
|
||
export def "filter-name text" [] { | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | record filter-name text a) {aa:1 ab:2 ba:3 ca:5} | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | record filter-name text -r ^a) {aa:1 ab:2} | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | record filter-name text -r ^A) {} | ||
} | ||
#[test] | ||
def test_record_filtervalue_predicate [] { | ||
use std assert | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | filter-value predicate { $in mod 2 == 0 }) {ab:2 bb:4 cb:6} | ||
|
||
export def "filter-value predicate" [] { | ||
assert equal ({aa:1 ab:2 ba:3 bb:4 ca:5 cb:6} | record filter-value predicate { $in mod 2 == 0 }) {ab:2 bb:4 cb:6} | ||
} |
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,15 +1,12 @@ | ||
#[test] | ||
def test_append [] { | ||
use std assert | ||
assert equal ("foo" | append "/") "foo/" | ||
assert equal (["foo", "bar", "baz"] | append "/") ["foo/", "bar/", "baz/"] | ||
use std assert | ||
use ../std-rfc str | ||
|
||
export def append [] { | ||
assert equal ("foo" | str append "/") "foo/" | ||
assert equal (["foo", "bar", "baz"] | str append "/") ["foo/", "bar/", "baz/"] | ||
} | ||
|
||
#[test] | ||
def test_prepend [] { | ||
use std assert | ||
assert equal ("foo" | prepend "/") "/foo" | ||
assert equal (["foo", "bar", "baz"] | prepend "/") ["/foo", "/bar", "/baz"] | ||
|
||
export def prepend [] { | ||
assert equal ("foo" | str prepend "/") "/foo" | ||
assert equal (["foo", "bar", "baz"] | str prepend "/") ["/foo", "/bar", "/baz"] | ||
} |