summaryrefslogtreecommitdiff
path: root/test/vis/text-objects
diff options
context:
space:
mode:
Diffstat (limited to 'test/vis/text-objects')
-rw-r--r--test/vis/text-objects/indentation.in16
-rw-r--r--test/vis/text-objects/indentation.keys4
-rw-r--r--test/vis/text-objects/indentation.ref16
-rw-r--r--test/vis/text-objects/lexer.in6
-rw-r--r--test/vis/text-objects/lexer.keys5
-rw-r--r--test/vis/text-objects/lexer.ref6
-rw-r--r--test/vis/text-objects/line.in6
-rw-r--r--test/vis/text-objects/line.keys9
-rw-r--r--test/vis/text-objects/line.ref2
-rw-r--r--test/vis/text-objects/search-result.in8
-rw-r--r--test/vis/text-objects/search-result.keys8
-rw-r--r--test/vis/text-objects/search-result.ref8
12 files changed, 94 insertions, 0 deletions
diff --git a/test/vis/text-objects/indentation.in b/test/vis/text-objects/indentation.in
new file mode 100644
index 0000000..8ab6759
--- /dev/null
+++ b/test/vis/text-objects/indentation.in
@@ -0,0 +1,16 @@
+static ssize_t write_all(int fd, const char *buf, size_t count) {
+ size_t rem = count;
+ while (rem > 0) {
+ ssize_t written = write(fd, buf, rem);
+ if (written < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ continue;
+ return -1;
+ } else if (written == 0) {
+ break;
+ }
+ rem -= written;
+ buf += written;
+ }
+ return count - rem;
+}
diff --git a/test/vis/text-objects/indentation.keys b/test/vis/text-objects/indentation.keys
new file mode 100644
index 0000000..75c612d
--- /dev/null
+++ b/test/vis/text-objects/indentation.keys
@@ -0,0 +1,4 @@
+/continue<Enter>
+3vi<Tab>
+:x/^/ c/\/\/<Enter>
+<Escape>
diff --git a/test/vis/text-objects/indentation.ref b/test/vis/text-objects/indentation.ref
new file mode 100644
index 0000000..ad35e8e
--- /dev/null
+++ b/test/vis/text-objects/indentation.ref
@@ -0,0 +1,16 @@
+static ssize_t write_all(int fd, const char *buf, size_t count) {
+ size_t rem = count;
+ while (rem > 0) {
+// ssize_t written = write(fd, buf, rem);
+// if (written < 0) {
+// if (errno == EAGAIN || errno == EINTR)
+// continue;
+// return -1;
+// } else if (written == 0) {
+// break;
+// }
+// rem -= written;
+// buf += written;
+ }
+ return count - rem;
+}
diff --git a/test/vis/text-objects/lexer.in b/test/vis/text-objects/lexer.in
new file mode 100644
index 0000000..275fc5f
--- /dev/null
+++ b/test/vis/text-objects/lexer.in
@@ -0,0 +1,6 @@
+/*
+ * cafe or tea?
+ */
+void drink() {
+ printf("cafe: %d\n", 0xcafebeef);
+}
diff --git a/test/vis/text-objects/lexer.keys b/test/vis/text-objects/lexer.keys
new file mode 100644
index 0000000..b738fa5
--- /dev/null
+++ b/test/vis/text-objects/lexer.keys
@@ -0,0 +1,5 @@
+:set syntax ansi_c<Enter>
+:x/cafe<Enter>
+ii
+:{ i/>/ a/</ }<Enter>
+<Escape>
diff --git a/test/vis/text-objects/lexer.ref b/test/vis/text-objects/lexer.ref
new file mode 100644
index 0000000..45b7ed5
--- /dev/null
+++ b/test/vis/text-objects/lexer.ref
@@ -0,0 +1,6 @@
+>/*
+ * cafe or tea?
+ */<
+void drink() {
+ printf(>"cafe: %d\n"<, >0xcafebeef<);
+}
diff --git a/test/vis/text-objects/line.in b/test/vis/text-objects/line.in
new file mode 100644
index 0000000..0c6acfa
--- /dev/null
+++ b/test/vis/text-objects/line.in
@@ -0,0 +1,6 @@
+normal line
+ normal line with white space
+normal line
+ normal line with white space
+inner line
+ inner line with white space
diff --git a/test/vis/text-objects/line.keys b/test/vis/text-objects/line.keys
new file mode 100644
index 0000000..0c3ee72
--- /dev/null
+++ b/test/vis/text-objects/line.keys
@@ -0,0 +1,9 @@
+dal
+.
+2.
+cil>was an inner line<<Escape>
+.
+j
+.
+g0i|<Escape>
+$.
diff --git a/test/vis/text-objects/line.ref b/test/vis/text-objects/line.ref
new file mode 100644
index 0000000..4a8cc7b
--- /dev/null
+++ b/test/vis/text-objects/line.ref
@@ -0,0 +1,2 @@
+>was an inner line<
+| >was an inner line< |
diff --git a/test/vis/text-objects/search-result.in b/test/vis/text-objects/search-result.in
new file mode 100644
index 0000000..44421e4
--- /dev/null
+++ b/test/vis/text-objects/search-result.in
@@ -0,0 +1,8 @@
+// add static using gn
+void f1(void);
+void f2(void);
+void f3(void);
+// add static using gN
+void f4(void);
+void f5(void);
+void f6(void);
diff --git a/test/vis/text-objects/search-result.keys b/test/vis/text-objects/search-result.keys
new file mode 100644
index 0000000..051b4e2
--- /dev/null
+++ b/test/vis/text-objects/search-result.keys
@@ -0,0 +1,8 @@
+/void<Enter>
+cgnstatic void<Escape>
+2.
+.
+G$
+c2gNstatic void<Escape>
+3.
+.
diff --git a/test/vis/text-objects/search-result.ref b/test/vis/text-objects/search-result.ref
new file mode 100644
index 0000000..3713c1c
--- /dev/null
+++ b/test/vis/text-objects/search-result.ref
@@ -0,0 +1,8 @@
+// add static using gn
+static void f1(void);
+static void f2(void);
+static void f3(void);
+// add static using gN
+static void f4(void);
+static void f5(void);
+static void f6(void);