diff options
author | Rob Landley <rob@landley.net> | 2019-10-28 23:55:18 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-10-28 23:55:18 -0500 |
commit | dba8041341d9520a1c78df81938d0dd7d3b8b008 (patch) | |
tree | 7cb6652fb473921b4eefef76ba30ba9665ceb8b8 | |
parent | 78a4be9e6862b970ac33d5ea3f95c98e658a3557 (diff) | |
download | toybox-dba8041341d9520a1c78df81938d0dd7d3b8b008.tar.gz |
Some basic stat tests.
-rwxr-xr-x | tests/stat.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/stat.test b/tests/stat.test new file mode 100755 index 00000000..7c97e5fd --- /dev/null +++ b/tests/stat.test @@ -0,0 +1,18 @@ +#!/bin/bash + +[ -f testing.sh ] && . testing.sh + +#testing "name" "command" "result" "infile" "stdin" + +TZ=utc touch -at 200001010101.01 file +testcmd "as echo" "-c hello file" "hello\n" "" "" +testcmd "lone %" "-c % file" "%\n" "" "" +testcmd "%% escapes" "-c '%% and %% then %%' file" "% and % then %\n" "" "" +testcmd "%unknown = ?" "-c %q% file" "?%\n" "" "" + +TZ=utc testcmd "%x" "-c %x file" "2000-01-01 01:01:01.000000000 +0000\n" "" "" +TZ=utc testcmd "%X" "-c %X file" "946688461\n" "" "" + +TZ=utc touch -mt 200002020202.02 file +TZ=utc testcmd "%y" "-c %y file" "2000-02-02 02:02:02.000000000 +0000\n" "" "" +TZ=utc testcmd "%Y" "-c %Y file" "949456922\n" "" "" |