sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

0036-dc.sh (707B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 tmp=$$.tmp
      6 
      7 trap 'rm -f $tmp' EXIT
      8 trap 'exit $?' HUP INT TERM
      9 
     10 # Test i, o, k, I, O, K commands
     11 cat <<'EOF' >$tmp
     12 test 1:
     13 10
     14 test 2:
     15 10
     16 test 3:
     17 0
     18 test 4:
     19 16
     20 test 5:
     21 16
     22 10
     23 test 6:
     24 5
     25 test 7:
     26 A
     27 test 8:
     28 FF
     29 test 9:
     30 10
     31 test 10:
     32 1010
     33 test 11:
     34 10
     35 test 12:
     36 .33333
     37 test 13:
     38  12 15
     39 test 14:
     40  01 04 19 19
     41 test 15:
     42  01.10
     43 test 16:
     44 .05 00
     45 EOF
     46 
     47 $EXEC ../dc <<'EOF' | diff -u $tmp -
     48 [test 1:]pc Ip
     49 [test 2:]pc Op
     50 [test 3:]pc Kp
     51 [test 4:]pc 16i Ip
     52 [test 5:]pc Ao Ip Op
     53 [test 6:]pc Ai 5k Kp
     54 [test 7:]pc 16o 10p
     55 [test 8:]pc 255p
     56 [test 9:]pc 10o 16i Ap
     57 [test 10:]pc Ai 2o 10p
     58 [test 11:]pc Ao 2i 1010p
     59 [test 12:]pc Ai 5k 1 3/p
     60 [test 13:]pc 20o 255p
     61 [test 14:]pc 9999p
     62 [test 15:]pc 1.5p
     63 [test 16:]pc .25p
     64 EOF