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