From ef5ea09c8a7f608af7bff5574afae672e3f0adfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 2 Nov 2016 23:22:42 +0100 Subject: test/sam: add new test cases --- sam/addresses/lines.cmd | 6 ++++++ sam/addresses/lines.in | 20 ++++++++++++++++++++ sam/commands/filter-capitalize.cmd | 1 + sam/commands/filter-capitalize.in | 1 + sam/commands/loop-lines1.cmd | 4 ++++ sam/commands/loop-lines1.in | 10 ++++++++++ sam/commands/loop-lines2.cmd | 4 ++++ sam/commands/loop-lines2.in | 10 ++++++++++ sam/examples/comment-functions.cmd | 4 ++++ sam/examples/comment-functions.in | 15 +++++++++++++++ 10 files changed, 75 insertions(+) create mode 100644 sam/addresses/lines.cmd create mode 100644 sam/addresses/lines.in create mode 100644 sam/commands/filter-capitalize.cmd create mode 120000 sam/commands/filter-capitalize.in create mode 100644 sam/commands/loop-lines1.cmd create mode 100644 sam/commands/loop-lines1.in create mode 100644 sam/commands/loop-lines2.cmd create mode 100644 sam/commands/loop-lines2.in create mode 100644 sam/examples/comment-functions.cmd create mode 100644 sam/examples/comment-functions.in (limited to 'sam') diff --git a/sam/addresses/lines.cmd b/sam/addresses/lines.cmd new file mode 100644 index 0000000..20a62c6 --- /dev/null +++ b/sam/addresses/lines.cmd @@ -0,0 +1,6 @@ +10,10 c/--\n/ +16,17 { + i// +} +20d diff --git a/sam/addresses/lines.in b/sam/addresses/lines.in new file mode 100644 index 0000000..0ff3bbb --- /dev/null +++ b/sam/addresses/lines.in @@ -0,0 +1,20 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 diff --git a/sam/commands/filter-capitalize.cmd b/sam/commands/filter-capitalize.cmd new file mode 100644 index 0000000..ca9d989 --- /dev/null +++ b/sam/commands/filter-capitalize.cmd @@ -0,0 +1 @@ +,x/[a-zA-Z]+/ | tr a-z A-Z \ No newline at end of file diff --git a/sam/commands/filter-capitalize.in b/sam/commands/filter-capitalize.in new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/sam/commands/filter-capitalize.in @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/sam/commands/loop-lines1.cmd b/sam/commands/loop-lines1.cmd new file mode 100644 index 0000000..88ca881 --- /dev/null +++ b/sam/commands/loop-lines1.cmd @@ -0,0 +1,4 @@ +,x/^.*$/ a,\\, +,x/$/ c/#/ +,y/\n/ a/*/ +,x a/--/ diff --git a/sam/commands/loop-lines1.in b/sam/commands/loop-lines1.in new file mode 100644 index 0000000..f00c965 --- /dev/null +++ b/sam/commands/loop-lines1.in @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/sam/commands/loop-lines2.cmd b/sam/commands/loop-lines2.cmd new file mode 100644 index 0000000..a773f97 --- /dev/null +++ b/sam/commands/loop-lines2.cmd @@ -0,0 +1,4 @@ +,x/^.*$/ i,//, +,x/^/ c/#/ +,y/\n/ i/*/ +,x i/--/ diff --git a/sam/commands/loop-lines2.in b/sam/commands/loop-lines2.in new file mode 100644 index 0000000..f00c965 --- /dev/null +++ b/sam/commands/loop-lines2.in @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/sam/examples/comment-functions.cmd b/sam/examples/comment-functions.cmd new file mode 100644 index 0000000..87d04c4 --- /dev/null +++ b/sam/examples/comment-functions.cmd @@ -0,0 +1,4 @@ +x/^static/+- g/ int / .,+/^\}/ { + i,#if 0\n, + a,\n#endif\n, +} diff --git a/sam/examples/comment-functions.in b/sam/examples/comment-functions.in new file mode 100644 index 0000000..49c2452 --- /dev/null +++ b/sam/examples/comment-functions.in @@ -0,0 +1,15 @@ +static int addi(int a, int b) { + return a+b; +} + +static long addl(long a, long b) { + return a+b; +} + +static int muli(int a, int b) { + return a*b; +} + +static long mull(long a, long b) { + return a*b; +} -- cgit v1.2.3