2019-12-23 18:45:55 +08:00
|
|
|
#RUN: %fish -C 'set -l fish %fish' %s
|
2020-01-06 01:41:56 +08:00
|
|
|
time sleep 0
|
2019-12-20 23:53:09 +08:00
|
|
|
|
|
|
|
# These are a tad awkward because it picks the correct unit and adapts whitespace.
|
|
|
|
# The idea is that it's a table.
|
2022-02-22 05:43:36 +08:00
|
|
|
#CHECKERR: ________________________________________________________
|
|
|
|
#CHECKERR: Executed in {{[\d,.\s]*}} {{millis|micros|secs}} {{\s*}}fish {{\s*}}external
|
|
|
|
#CHECKERR: usr time {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}}
|
|
|
|
#CHECKERR: sys time {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}}
|
2019-12-20 23:53:09 +08:00
|
|
|
time for i in (seq 1 2)
|
|
|
|
echo banana
|
|
|
|
end
|
|
|
|
|
|
|
|
#CHECK: banana
|
|
|
|
#CHECK: banana
|
2022-02-22 05:43:36 +08:00
|
|
|
#CHECKERR: ________________________________________________________
|
|
|
|
#CHECKERR: Executed in {{[\d,.\s]*}} {{millis|micros|secs}} {{\s*}}fish {{\s*}}external
|
|
|
|
#CHECKERR: usr time {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}}
|
|
|
|
#CHECKERR: sys time {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}}
|
2019-12-20 23:53:09 +08:00
|
|
|
|
|
|
|
# Make sure we're not double-parsing
|
|
|
|
time echo 'foo -s bar'
|
|
|
|
#CHECK: foo -s bar
|
2022-02-22 05:43:36 +08:00
|
|
|
#CHECKERR: ________________________________________________________
|
|
|
|
#CHECKERR: Executed in {{[\d,.\s]*}} {{millis|micros|secs}} {{\s*}}fish {{\s*}}external
|
|
|
|
#CHECKERR: usr time {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}}
|
|
|
|
#CHECKERR: sys time {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}} {{[\d,.\s]*}} {{millis|micros|secs}}
|
2019-12-21 18:45:07 +08:00
|
|
|
|
|
|
|
true && time a=b not builtin true | true
|
2022-02-22 05:43:36 +08:00
|
|
|
#CHECKERR: ___{{.*}}
|
2019-12-21 18:45:07 +08:00
|
|
|
#CHECKERR: {{.*}}
|
|
|
|
#CHECKERR: {{.*}}
|
|
|
|
#CHECKERR: {{.*}}
|
|
|
|
|
|
|
|
not time true
|
2022-02-22 05:43:36 +08:00
|
|
|
#CHECKERR: ___{{.*}}
|
2019-12-21 18:45:07 +08:00
|
|
|
#CHECKERR: {{.*}}
|
|
|
|
#CHECKERR: {{.*}}
|
|
|
|
#CHECKERR: {{.*}}
|
2019-12-23 18:45:55 +08:00
|
|
|
|
|
|
|
$fish -c 'time true&'
|
|
|
|
#CHECKERR: fish: {{.*}}
|
|
|
|
#CHECKERR: time true&
|
2022-08-11 23:22:03 +08:00
|
|
|
#CHECKERR: ^~~~~~~~~^
|
2019-12-23 18:45:55 +08:00
|
|
|
|
|
|
|
$fish -c 'not time true&'
|
|
|
|
#CHECKERR: fish: {{.*}}
|
|
|
|
#CHECKERR: not time true&
|
2022-08-12 00:20:40 +08:00
|
|
|
#FIXME: This error marks the entire statement. Would be cool to mark just `time true&`.
|
|
|
|
#CHECKERR: ^~~~~~~~~~~~~^
|
2023-08-26 01:34:24 +08:00
|
|
|
|
|
|
|
$fish -c 'echo Is it time yet | time cat'
|
|
|
|
#CHECKERR: fish: The 'time' command may only be at the beginning of a pipeline
|
|
|
|
#CHECKERR: echo Is it time yet | time cat
|
|
|
|
#CHECKERR: ^~~~~~~^
|
|
|
|
|
|
|
|
begin
|
|
|
|
printf '%s\n' "#!/bin/sh" 'echo No this is Patrick' > time
|
|
|
|
chmod +x time
|
|
|
|
set -l PATH .
|
|
|
|
echo Hello is this time | command time
|
|
|
|
# CHECK: No this is Patrick
|
|
|
|
end
|
|
|
|
rm time
|