Files
dotfiles/dot_config/nushell/nu_scripts/stdlib-candidate/tests/conversions.nu
Cian Hughes 896af887ca Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows)
and improves grepability with neovim/telescope
2024-11-07 13:52:17 +00:00

44 lines
633 B
Nu

use std assert
use ../std-rfc/conversions *
export def "test range-into-list" [] {
assert equal (
1..10 | into list
) (
[ 1 2 3 4 5 6 7 8 9 10 ]
)
}
export def "test string-into-list" [] {
assert equal (
"foo" | into list
) (
[ foo ]
)
}
export def "test range-stride-into-list" [] {
assert equal (
0..2..10 | into list
) (
[ 0 2 4 6 8 10 ]
)
}
export def "test null-into-list" [] {
assert equal (
null | into list | get 0 | describe
) (
"nothing"
)
}
export def "test list-into-list" [] {
assert equal (
[ foo bar baz ] | into list
) (
[ foo bar baz ]
)
}