aboutsummaryrefslogtreecommitdiffstats
path: root/testcases-field
diff options
context:
space:
mode:
Diffstat (limited to 'testcases-field')
-rw-r--r--testcases-field176
1 files changed, 176 insertions, 0 deletions
diff --git a/testcases-field b/testcases-field
new file mode 100644
index 0000000..788f325
--- /dev/null
+++ b/testcases-field
@@ -0,0 +1,176 @@
+1:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = ""
+ delf(1, 0)
+ pf
+ delf(1, 5)
+ pf
+ delf(3, 5)
+ pf
+}'
+:
+nil
+nil
+nil
+--
+2:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = "1 2 3 4"
+ delf(1, 1)
+ pf
+ delf(2, 1)
+ pf
+ delf(3, 0)
+ pf
+ delf(0, 0)
+ pf
+ delf(1, 2)
+ pf
+}'
+:
+(2 3 4)
+(2 4)
+(2 4)
+(2 4)
+nil
+--
+3:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = "1 2 3 4 5"
+ delf(1)
+ pf
+ delf(1)
+ pf
+ delf(1, 10)
+ pf
+}'
+:
+(2 3 4 5)
+(3 4 5)
+nil
+--
+4:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = "1 2 3 4 5"
+ delf(5)
+ pf
+ delf(4)
+ pf
+ delf(3, 15)
+ pf
+ delf(2, 1000)
+ pf
+ delf(1)
+ pf
+}'
+:
+(1 2 3 4)
+(1 2 3)
+(1 2)
+(1)
+nil
+--
+5:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = "1 2 3 4 5"
+ delf(4, 13)
+ pf
+}'
+:
+(1 2 3)
+--
+6:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = "1 2 3 4 5"
+ delf(2, 3)
+ pf
+}'
+:
+(1 5)
+--
+7:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = ""
+ insf(1, 1)
+ pf
+ insf(2, 2)
+ pf
+ insf(3, 3)
+ pf
+ insf(4, 4, 5, 6)
+ pf
+}'
+:
+(1)
+(1 2)
+(1 2 3)
+(1 2 3 4 5 6)
+--
+8:
+$cppawk '
+#include <cons.h>
+#include <field.h>
+
+#define pf {print sexp(fields())}
+
+BEGIN {
+ $0 = ""
+ insf(3, 3, 4)
+ pf
+ insf(5, 5, 6)
+ pf
+ insf(9, 9)
+ pf
+ insf(0, 1, 2, 3)
+ pf
+ insf(1, 1, 2)
+ pf
+}'
+:
+(nil nil 3 4)
+(nil nil 3 4 5 6)
+(nil nil 3 4 5 6 nil nil 9)
+(nil nil 3 4 5 6 nil nil 9)
+(1 2 nil nil 3 4 5 6 nil nil 9)