From 0a3fdd77894a02c63cc14592505a4dbaaeaf7af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 2 Feb 2017 13:43:34 +0100 Subject: test/sam: add more tests --- sam/addresses/columns.cmd | 5 ++++- sam/addresses/first-last.cmd | 4 ++++ sam/addresses/first-last.in | 4 ++++ sam/addresses/second.cmd | 4 ++++ sam/addresses/second.in | 4 ++++ sam/commands/group.cmd | 5 +++++ sam/commands/group.in | 1 + sam/commands/long-text.cmd | 11 +++++++++++ sam/commands/long-text.in | 0 sam/commands/pipe-out.cmd | 5 +++++ sam/commands/pipe-out.in | 1 + sam/commands/repeated-shell.cmd | 2 ++ sam/commands/repeated-shell.in | 2 ++ sam/errors/conflict.cmd | 4 ++++ sam/errors/conflict.in | 1 + sam/errors/filter.cmd | 1 + sam/errors/filter.in | 1 + sam/errors/filter.ref | 1 + sam/errors/pipe-in.cmd | 1 + sam/errors/pipe-in.in | 1 + sam/errors/pipe-in.ref | 1 + sam/errors/read.cmd | 1 + sam/errors/read.in | 1 + sam/errors/unbalanced-group.cmd | 5 +++++ sam/errors/unbalanced-group.in | 1 + 25 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 sam/addresses/first-last.cmd create mode 100644 sam/addresses/first-last.in create mode 100644 sam/addresses/second.cmd create mode 100644 sam/addresses/second.in create mode 100644 sam/commands/group.cmd create mode 100644 sam/commands/group.in create mode 100644 sam/commands/long-text.cmd create mode 100644 sam/commands/long-text.in create mode 100644 sam/commands/pipe-out.cmd create mode 100644 sam/commands/pipe-out.in create mode 100644 sam/commands/repeated-shell.cmd create mode 100644 sam/commands/repeated-shell.in create mode 100644 sam/errors/conflict.cmd create mode 100644 sam/errors/conflict.in create mode 100644 sam/errors/filter.cmd create mode 100644 sam/errors/filter.in create mode 100644 sam/errors/filter.ref create mode 100644 sam/errors/pipe-in.cmd create mode 100644 sam/errors/pipe-in.in create mode 100644 sam/errors/pipe-in.ref create mode 100644 sam/errors/read.cmd create mode 100644 sam/errors/read.in create mode 100644 sam/errors/unbalanced-group.cmd create mode 100644 sam/errors/unbalanced-group.in diff --git a/sam/addresses/columns.cmd b/sam/addresses/columns.cmd index 80110dc..b00f736 100644 --- a/sam/addresses/columns.cmd +++ b/sam/addresses/columns.cmd @@ -1 +1,4 @@ -,x/def/ -/^/+#10 i/|/ +,x/def|uvw/ { + g/def/ -/^/+#10 i/|/ + g/uvw/ +/$/-#10 i/|/ +} diff --git a/sam/addresses/first-last.cmd b/sam/addresses/first-last.cmd new file mode 100644 index 0000000..ff1d6fc --- /dev/null +++ b/sam/addresses/first-last.cmd @@ -0,0 +1,4 @@ +0/Emacs/,$-/Emacs/ { + i/>>/ + a/<>/ + a/< cat > pipe-out.tmp +0 < cat pipe-out.tmp +0 r pipe-out.tmp +! rm pipe-out.tmp +0 < cat pipe-out.tmp diff --git a/sam/commands/pipe-out.in b/sam/commands/pipe-out.in new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/sam/commands/pipe-out.in @@ -0,0 +1 @@ +Hello World diff --git a/sam/commands/repeated-shell.cmd b/sam/commands/repeated-shell.cmd new file mode 100644 index 0000000..643e1d1 --- /dev/null +++ b/sam/commands/repeated-shell.cmd @@ -0,0 +1,2 @@ +1 | tr a-z A-Z +2 | diff --git a/sam/commands/repeated-shell.in b/sam/commands/repeated-shell.in new file mode 100644 index 0000000..f9264f7 --- /dev/null +++ b/sam/commands/repeated-shell.in @@ -0,0 +1,2 @@ +Hello +World diff --git a/sam/errors/conflict.cmd b/sam/errors/conflict.cmd new file mode 100644 index 0000000..8397024 --- /dev/null +++ b/sam/errors/conflict.cmd @@ -0,0 +1,4 @@ +,{ +c/text1/ +c/text2/ +} diff --git a/sam/errors/conflict.in b/sam/errors/conflict.in new file mode 100644 index 0000000..980a0d5 --- /dev/null +++ b/sam/errors/conflict.in @@ -0,0 +1 @@ +Hello World! diff --git a/sam/errors/filter.cmd b/sam/errors/filter.cmd new file mode 100644 index 0000000..e54b088 --- /dev/null +++ b/sam/errors/filter.cmd @@ -0,0 +1 @@ +1 | tr a-z A-Z && false diff --git a/sam/errors/filter.in b/sam/errors/filter.in new file mode 100644 index 0000000..4afca5f --- /dev/null +++ b/sam/errors/filter.in @@ -0,0 +1 @@ +Filter command failed diff --git a/sam/errors/filter.ref b/sam/errors/filter.ref new file mode 100644 index 0000000..4afca5f --- /dev/null +++ b/sam/errors/filter.ref @@ -0,0 +1 @@ +Filter command failed diff --git a/sam/errors/pipe-in.cmd b/sam/errors/pipe-in.cmd new file mode 100644 index 0000000..033cefb --- /dev/null +++ b/sam/errors/pipe-in.cmd @@ -0,0 +1 @@ +1 < echo FAILED && false diff --git a/sam/errors/pipe-in.in b/sam/errors/pipe-in.in new file mode 100644 index 0000000..b130b9a --- /dev/null +++ b/sam/errors/pipe-in.in @@ -0,0 +1 @@ +Pipe in command failed diff --git a/sam/errors/pipe-in.ref b/sam/errors/pipe-in.ref new file mode 100644 index 0000000..b130b9a --- /dev/null +++ b/sam/errors/pipe-in.ref @@ -0,0 +1 @@ +Pipe in command failed diff --git a/sam/errors/read.cmd b/sam/errors/read.cmd new file mode 100644 index 0000000..7685f9d --- /dev/null +++ b/sam/errors/read.cmd @@ -0,0 +1 @@ +1 r not-found diff --git a/sam/errors/read.in b/sam/errors/read.in new file mode 100644 index 0000000..1b88518 --- /dev/null +++ b/sam/errors/read.in @@ -0,0 +1 @@ +Read non-existing file diff --git a/sam/errors/unbalanced-group.cmd b/sam/errors/unbalanced-group.cmd new file mode 100644 index 0000000..0a8faf2 --- /dev/null +++ b/sam/errors/unbalanced-group.cmd @@ -0,0 +1,5 @@ +{ + i/>/ + { + a/