Home | History | Annotate | Download | only in tests
      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
     13 ln -s java.class symlink
     14 
     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" "" ""
     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" "" ""
     24 
     25 rm empty bash.script bash.script2 env.python.script ascii java.class
     26