OILS / test / lossless / here-multiple.sh View on Github | oilshell.org

23 lines, 5 significant
1#!/usr/bin/env bash
2
3# Compare osh code on stdin (fd 0) and expected oil code on fd 3.
4osh0-oil3() {
5 bin/osh --fix "$@" | diff -u /dev/fd/3 - || { echo FAIL; exit 1; }
6}
7
8osh0-oil3 << 'OSH' 2>&1 3<< 'OIL'
9x=1
10OSH
11x = 1
12OIL
13
14osh0-oil3 << 'OSH' 2>&1 lossless-invariant 3<< 'OIL' "lossless"
151
162
173
18OSH
19x
20y
21 zz
22OIL
23