Merge pull request #700 from Golmote/tests-git Add tests for git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
diff --git a/tests/languages/git/command_feature.test b/tests/languages/git/command_feature.test
new file mode 100644
index 0000000..488f0be
--- /dev/null
+++ b/tests/languages/git/command_feature.test
@@ -0,0 +1,15 @@
+$ git add file.txt
+foo@foobar ~ $ git diff --cached
+$ git log -p -i
+
+----------------------------------------------------
+
+[
+ ["command", ["$ git add file.txt"]],
+ ["command", ["foo@foobar ~ $ git diff", ["parameter", " --cached"]]],
+ ["command", ["$ git log", ["parameter", " -p"], ["parameter", " -i"]]]
+]
+
+----------------------------------------------------
+
+Checks for git commands, with and without parameters.
\ No newline at end of file
diff --git a/tests/languages/git/comment_feature.test b/tests/languages/git/comment_feature.test
new file mode 100644
index 0000000..c3d0358
--- /dev/null
+++ b/tests/languages/git/comment_feature.test
@@ -0,0 +1,17 @@
+# On branch gh-pages
+# Changes to be committed:
+# (use "git reset HEAD <file>..." to unstage)
+#
+
+----------------------------------------------------
+
+[
+ ["comment", "# On branch gh-pages"],
+ ["comment", "# Changes to be committed:"],
+ ["comment", "# (use \"git reset HEAD <file>...\" to unstage)"],
+ ["comment", "#"]
+]
+
+----------------------------------------------------
+
+Checks for comments.
\ No newline at end of file
diff --git a/tests/languages/git/commit_sha1_feature.test b/tests/languages/git/commit_sha1_feature.test
new file mode 100644
index 0000000..fbc58ed
--- /dev/null
+++ b/tests/languages/git/commit_sha1_feature.test
@@ -0,0 +1,15 @@
+commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09
+commit 87edc4ad8c71b95f6e46f736eb98b742859abd95
+commit 3102416a90c431400d2e2a14e707fb7fd6d9e06d
+
+----------------------------------------------------
+
+[
+ ["commit_sha1", "commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09"],
+ ["commit_sha1", "commit 87edc4ad8c71b95f6e46f736eb98b742859abd95"],
+ ["commit_sha1", "commit 3102416a90c431400d2e2a14e707fb7fd6d9e06d"]
+]
+
+----------------------------------------------------
+
+Checks for commit SHA1.
\ No newline at end of file
diff --git a/tests/languages/git/coord_feature.test b/tests/languages/git/coord_feature.test
new file mode 100644
index 0000000..8d8c5e2
--- /dev/null
+++ b/tests/languages/git/coord_feature.test
@@ -0,0 +1,13 @@
+@@ -1 +1,2 @@
+@@@ -98,20 -98,12 +98,20 @@@
+
+----------------------------------------------------
+
+[
+ ["coord", "@@ -1 +1,2 @@"],
+ ["coord", "@@@ -98,20 -98,12 +98,20 @@@"]
+]
+
+----------------------------------------------------
+
+Checks for coords.
\ No newline at end of file
diff --git a/tests/languages/git/diff_feature.test b/tests/languages/git/diff_feature.test
new file mode 100644
index 0000000..3c75cca
--- /dev/null
+++ b/tests/languages/git/diff_feature.test
@@ -0,0 +1,15 @@
+-Here's my tetx file
++Here's my text file
++And this is the second line
+
+----------------------------------------------------
+
+[
+ ["deleted", "-Here's my tetx file"],
+ ["inserted", "+Here's my text file"],
+ ["inserted", "+And this is the second line"]
+]
+
+----------------------------------------------------
+
+Checks for inserted and deleted lines in git diff output.
\ No newline at end of file
diff --git a/tests/languages/git/string_feature.test b/tests/languages/git/string_feature.test
new file mode 100644
index 0000000..ebff3bf
--- /dev/null
+++ b/tests/languages/git/string_feature.test
@@ -0,0 +1,17 @@
+""
+"foo"
+''
+'bar'
+
+----------------------------------------------------
+
+[
+ ["string", "\"\""],
+ ["string", "\"foo\""],
+ ["string", "''"],
+ ["string", "'bar'"]
+]
+
+----------------------------------------------------
+
+Checks for double-quoted and single-quoted strings.
\ No newline at end of file