• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
7testcmd "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" "" \
12  "V2UndmUgcmVwbGFjZWQgdGhlIGRpbGl0aGl1bSB0aGV5IG5vcm1hbGx5IHVzZSB3aXRoIEZvbGdl\ncidzIENyeXN0YWxzLg==\n" \
13  "" "We've replaced the dilithium they normally use with Folger's Crystals."
14testcmd "multiline -d " "-d" \
15 "We've replaced the dilithium they normally use with Folger's Crystals." "" \
16  "V2UndmUgcmVwbGFjZWQgdGhlIGRpbGl0aGl1bSB0aGV5IG5vcm1hbGx5IHVzZSB3aXRoIEZvbGdl\ncidzIENyeXN0YWxzLg==\n"
17
18testcmd "-w" "-w 10" \
19  "TWFyY2hpbm\ncgdG8gdGhl\nIGJlYXQgb2\nYgYSBkaWZm\nZXJlbnQga2\nV0dGxlIG9m\nIGZpc2guCg\n==\n" \
20  "" "Marching to the beat of a different kettle of fish.\n"
21
22testcmd "-w0" "-w0 input" \
23  "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" ""
25