aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-01-12 13:56:52 (GMT)
committerJosh Kropf <josh@slashdev.ca>2012-01-12 18:24:35 (GMT)
commit33e7b3150fca37b3857aefa757dff6ae19ad8904 (patch)
treea54ce879f73f05ff0ed84467448bf99f3dc41908
parent07fc4ed3bd0b46e04e705e885ae91bc38c63cd6d (diff)
downloadgedit-autotab-33e7b3150fca37b3857aefa757dff6ae19ad8904.zip
gedit-autotab-33e7b3150fca37b3857aefa757dff6ae19ad8904.tar.gz
gedit-autotab-33e7b3150fca37b3857aefa757dff6ae19ad8904.tar.bz2
Create some test cases so it's easier to regression test changes.
-rw-r--r--tests/header.c21
-rw-r--r--tests/spaces-2.c10
-rw-r--r--tests/spaces-3.c10
-rw-r--r--tests/spaces-4.c10
-rw-r--r--tests/spaces-8.c10
-rw-r--r--tests/tabs-aligned.c10
-rw-r--r--tests/tabs.c10
7 files changed, 81 insertions, 0 deletions
diff --git a/tests/header.c b/tests/header.c
new file mode 100644
index 0000000..32898dd
--- /dev/null
+++ b/tests/header.c
@@ -0,0 +1,21 @@
+/* This file uses 4 spaces for indentation */
+
+/*
+ * But it also has these function header that can confuse things.
+ */
+int main(int argc, char **argv)
+{
+ hello_world();
+}
+
+/*
+ * Second function header.
+ */
+int hello_world();
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}
diff --git a/tests/spaces-2.c b/tests/spaces-2.c
new file mode 100644
index 0000000..e3aac70
--- /dev/null
+++ b/tests/spaces-2.c
@@ -0,0 +1,10 @@
+/* This file uses 2 spaces for indentation */
+
+int main(int argc, char **argv)
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}
diff --git a/tests/spaces-3.c b/tests/spaces-3.c
new file mode 100644
index 0000000..2d3f0cf
--- /dev/null
+++ b/tests/spaces-3.c
@@ -0,0 +1,10 @@
+/* This file uses 3 spaces for indentation */
+
+int main(int argc, char **argv)
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}
diff --git a/tests/spaces-4.c b/tests/spaces-4.c
new file mode 100644
index 0000000..79e9ed2
--- /dev/null
+++ b/tests/spaces-4.c
@@ -0,0 +1,10 @@
+/* This file uses 4 spaces for indentation */
+
+int main(int argc, char **argv)
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}
diff --git a/tests/spaces-8.c b/tests/spaces-8.c
new file mode 100644
index 0000000..14c15e1
--- /dev/null
+++ b/tests/spaces-8.c
@@ -0,0 +1,10 @@
+/* This file uses 8 spaces for indentation */
+
+int main(int argc, char **argv)
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}
diff --git a/tests/tabs-aligned.c b/tests/tabs-aligned.c
new file mode 100644
index 0000000..7d4fb89
--- /dev/null
+++ b/tests/tabs-aligned.c
@@ -0,0 +1,10 @@
+/* This file uses tabs for indentation, but spaces for alignment */
+
+int main(int argc, char **argv)
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}
diff --git a/tests/tabs.c b/tests/tabs.c
new file mode 100644
index 0000000..b3a10ae
--- /dev/null
+++ b/tests/tabs.c
@@ -0,0 +1,10 @@
+/* This file uses just tabs for indentation */
+
+int main(int argc, char **argv)
+{
+ printf("Hello world!\n");
+ if (argc >= 2) {
+ printf("Your first argument is %s\n",
+ argv[0]);
+ }
+}