blob: 7e5a99a3fcae82a25890d4ee411f74192b755f4f [file] [log] [blame]
Rob Landley2665cd02016-03-15 15:02:21 -05001#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
Rob Landley216e4da2017-04-04 18:13:51 -05007testcmd "simple" "" "c2ltcGxlCg==\n" "" "simple\n"
8testcmd "file" "input" "c2ltcGxlCg==\n" "simple\n" ""
9testcmd "simple -d" "-d" "simple\n" "" "c2ltcGxlCg==\n"
10testcmd "simple -d" "-d input" "simple\n" "c2ltcGxlCg==" ""
11testcmd "default wrap" "" \
Rob Landley2665cd02016-03-15 15:02:21 -050012 "V2UndmUgcmVwbGFjZWQgdGhlIGRpbGl0aGl1bSB0aGV5IG5vcm1hbGx5IHVzZSB3aXRoIEZvbGdl\ncidzIENyeXN0YWxzLg==\n" \
13 "" "We've replaced the dilithium they normally use with Folger's Crystals."
Rob Landley216e4da2017-04-04 18:13:51 -050014testcmd "multiline -d " "-d" \
Rob Landley2665cd02016-03-15 15:02:21 -050015 "We've replaced the dilithium they normally use with Folger's Crystals." "" \
16 "V2UndmUgcmVwbGFjZWQgdGhlIGRpbGl0aGl1bSB0aGV5IG5vcm1hbGx5IHVzZSB3aXRoIEZvbGdl\ncidzIENyeXN0YWxzLg==\n"
17
Rob Landley216e4da2017-04-04 18:13:51 -050018testcmd "-w" "-w 10" \
Rob Landley2665cd02016-03-15 15:02:21 -050019 "TWFyY2hpbm\ncgdG8gdGhl\nIGJlYXQgb2\nYgYSBkaWZm\nZXJlbnQga2\nV0dGxlIG9m\nIGZpc2guCg\n==\n" \
20 "" "Marching to the beat of a different kettle of fish.\n"
21
Rob Landley216e4da2017-04-04 18:13:51 -050022testcmd "-w0" "-w0 input" \
Rob Landley2665cd02016-03-15 15:02:21 -050023 "VmlraW5ncz8gVGhlcmUgYWluJ3Qgbm8gdmlraW5ncyBoZXJlLiBKdXN0IHVzIGhvbmVzdCBmYXJtZXJzLiBUaGUgdG93biB3YXMgYnVybmluZywgdGhlIHZpbGxhZ2VycyB3ZXJlIGRlYWQuIFRoZXkgZGlkbid0IG5lZWQgdGhvc2Ugc2hlZXAgYW55d2F5LiBUaGF0J3Mgb3VyIHN0b3J5IGFuZCB3ZSdyZSBzdGlja2luZyB0byBpdC4K" \
24 "Vikings? There ain't no vikings here. Just us honest farmers. The town was burning, the villagers were dead. They didn't need those sheep anyway. That's our story and we're sticking to it.\n" ""