summaryrefslogtreecommitdiff
path: root/test-suite/standalone/test-guile-snarf
blob: 41a9dc64acb802ba35725c9be38d66237fc02102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
snarf ()
{
    echo "$1" | guile-snarf - | tail -n +2 | tr -d ' \t\n'
}

snarf_test ()
{
    x=`snarf "$1"`
    if [ x"$x" != x"$2" ]; then
        echo "Incorrect output: expected \"$2\", but got \"$x\""
        exit 1
    fi
}

snarf_test "^^a^:^" "a;"
snarf_test "  ^  ^  b  ^  :  ^  " "b;"
snarf_test "c\n^^d^:^\ne" "d;"
snarf_test "f^^g^:^h" "g;"
snarf_test "^^i^:^j^^k^:^" "i;k;"
snarf_test "l^^m" ""
snarf_test "n^:^o" ""