blob: 4c7f001c9e0eebe1dc71625a629932766bc52662 [file] [log] [blame]
Elliott Hughesffc6fbb2016-02-29 19:35:13 -08001#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
7touch empty
8echo "#!/bin/bash" > bash.script
9echo "#! /bin/bash" > bash.script2
10echo "#! /usr/bin/env python" > env.python.script
11echo "Hello, world!" > ascii
12echo "cafebabe000000310000" | xxd -r -p > java.class
Elliott Hughes493dc572016-09-13 13:55:59 -070013ln -s java.class symlink
Elliott Hughesffc6fbb2016-02-29 19:35:13 -080014
Rob Landleyb52f6422016-03-23 03:30:23 -050015testing "empty" "file empty" "empty: empty\n" "" ""
16testing "bash.script" "file bash.script" "bash.script: /bin/bash script\n" "" ""
17testing "bash.script with spaces" "file bash.script2" "bash.script2: /bin/bash script\n" "" ""
18testing "env python script" "file env.python.script" "env.python.script: python script\n" "" ""
19testing "ascii" "file ascii" "ascii: ASCII text\n" "" ""
20testing "java class" "file java.class" "java.class: Java class file, version 49.0\n" "" ""
Elliott Hughes493dc572016-09-13 13:55:59 -070021testing "symlink" "file symlink" "symlink: symbolic link\n" "" ""
22testing "symlink -h" "file -h symlink" "symlink: symbolic link\n" "" ""
23testing "symlink -L" "file -L symlink" "symlink: Java class file, version 49.0\n" "" ""
Elliott Hughesffc6fbb2016-02-29 19:35:13 -080024
25rm empty bash.script bash.script2 env.python.script ascii java.class