Thread (6 messages) flat view 6 messages, 1 author, 2016-06-15
DORMANTno replies

[StGit PATCH 3/5] Simple test for "stg clean"

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:43:47
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Karl Hasselström <redacted>

---

 t/t2500-clean.sh |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100755 t/t2500-clean.sh

diff --git a/t/t2500-clean.sh b/t/t2500-clean.sh
new file mode 100755
index 0000000..3364c18
--- /dev/null
+++ b/t/t2500-clean.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+test_description='Run "stg clean"'
+
+. ./test-lib.sh
+
+test_expect_success 'Initialize StGit stack' '
+    stg init &&
+    stg new e0 -m e0 &&
+    stg new p0 -m p0 &&
+    echo foo > foo.txt &&
+    git add foo.txt &&
+    stg refresh &&
+    stg new e1 -m e1 &&
+    stg new e2 -m e2 &&
+    stg pop
+'
+
+test_expect_success 'Clean empty patches' '
+    [ "$(echo $(stg applied))" = "e0 p0 e1" ] &&
+    [ "$(echo $(stg unapplied))" = "e2" ] &&
+    stg clean &&
+    [ "$(echo $(stg applied))" = "p0" ] &&
+    [ "$(echo $(stg unapplied))" = "" ]
+'
+
+test_done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help