mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-02 23:31:57 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
35 lines
640 B
Nu
35 lines
640 B
Nu
use ../playground *
|
|
use ../std/date.nu *
|
|
|
|
def mock-now [] {
|
|
"2021-08-29 03:31:21" | into datetime
|
|
}
|
|
|
|
def people [] {
|
|
[
|
|
[ 'name', 'tz'];
|
|
[ 'andres', 'America/Guayaquil']
|
|
[ 'fdncred', 'US/Central']
|
|
]
|
|
}
|
|
|
|
playground "std/date" {
|
|
|
|
scene 'command: "date local"' {
|
|
|
|
play "adds times in local timezone" {|topic|
|
|
|
|
let expected_times = [
|
|
"Sun Aug 29 03:31:21 2021"
|
|
"Sun Aug 29 03:31:21 2021"
|
|
] | into datetime;
|
|
let actual = (people | date local (mock-now) | get time | into datetime)
|
|
|
|
expect $topic $actual --to-be $expected_times
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|