Elliott Hughes | ffc6fbb | 2016-02-29 19:35:13 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | [ -f testing.sh ] && . testing.sh |
| 4 | |
| 5 | #testing "name" "command" "result" "infile" "stdin" |
| 6 | |
| 7 | touch empty |
| 8 | echo "#!/bin/bash" > bash.script |
| 9 | echo "#! /bin/bash" > bash.script2 |
| 10 | echo "#! /usr/bin/env python" > env.python.script |
| 11 | echo "Hello, world!" > ascii |
| 12 | echo "cafebabe000000310000" | xxd -r -p > java.class |
Elliott Hughes | 493dc57 | 2016-09-13 13:55:59 -0700 | [diff] [blame] | 13 | ln -s java.class symlink |
Elliott Hughes | ffc6fbb | 2016-02-29 19:35:13 -0800 | [diff] [blame] | 14 | |
Rob Landley | b52f642 | 2016-03-23 03:30:23 -0500 | [diff] [blame] | 15 | testing "empty" "file empty" "empty: empty\n" "" "" |
| 16 | testing "bash.script" "file bash.script" "bash.script: /bin/bash script\n" "" "" |
| 17 | testing "bash.script with spaces" "file bash.script2" "bash.script2: /bin/bash script\n" "" "" |
| 18 | testing "env python script" "file env.python.script" "env.python.script: python script\n" "" "" |
| 19 | testing "ascii" "file ascii" "ascii: ASCII text\n" "" "" |
| 20 | testing "java class" "file java.class" "java.class: Java class file, version 49.0\n" "" "" |
Elliott Hughes | 493dc57 | 2016-09-13 13:55:59 -0700 | [diff] [blame] | 21 | testing "symlink" "file symlink" "symlink: symbolic link\n" "" "" |
| 22 | testing "symlink -h" "file -h symlink" "symlink: symbolic link\n" "" "" |
| 23 | testing "symlink -L" "file -L symlink" "symlink: Java class file, version 49.0\n" "" "" |
Elliott Hughes | ffc6fbb | 2016-02-29 19:35:13 -0800 | [diff] [blame] | 24 | |
| 25 | rm empty bash.script bash.script2 env.python.script ascii java.class |