-
Notifications
You must be signed in to change notification settings - Fork 238
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
954c1a8
commit 36c07d7
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 "test 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 "test 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 "test 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 "test 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 "test 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 "test prepend" [] { | ||
assert equal ("foo" | str prepend "/") "/foo" | ||
assert equal (["foo", "bar", "baz"] | str prepend "/") ["/foo", "/bar", "/baz"] | ||
} |