• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/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
13ln -s java.class symlink
14
15testing "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" "" ""
21testing "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" "" ""
24
25rm empty bash.script bash.script2 env.python.script ascii java.class
26