stat.test 660 B

123456789101112131415161718
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. TZ=utc touch -at 200001010101.01 file
  5. testcmd "as echo" "-c hello file" "hello\n" "" ""
  6. testcmd "lone %" "-c % file" "%\n" "" ""
  7. testcmd "%% escapes" "-c '%% and %% then %%' file" "% and % then %\n" "" ""
  8. testcmd "%unknown = ?" "-c %q% file" "?%\n" "" ""
  9. TZ=utc testcmd "%x" "-c %x file" "2000-01-01 01:01:01.000000000 +0000\n" "" ""
  10. TZ=utc testcmd "%X" "-c %X file" "946688461\n" "" ""
  11. TZ=utc touch -mt 200002020202.02 file
  12. TZ=utc testcmd "%y" "-c %y file" "2000-02-02 02:02:02.000000000 +0000\n" "" ""
  13. TZ=utc testcmd "%Y" "-c %Y file" "949456922\n" "" ""