{"thread":{"id":"8134","subject":"[StGIT PATCH 1/3] Make patch deletion test more specific","startedAt":"2007-05-13T18:27:20Z","lastAt":"2007-05-13T18:27:30Z","messageCount":3,"participants":["Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"42036","messageId":"20070513182720.18810.64330.stgit@yoghurt","threadId":"8134","inReplyTo":null,"subject":"[StGIT PATCH 1/3] Make patch deletion test more specific","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-13T18:27:20Z","receivedAt":"2007-05-13T18:27:20Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nDon't just test the number of applied and unapplied patches; also test\ntheir name and order.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n t/t1601-delete-many.sh |   38 +++++++++++++++++++-------------------\n 1 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t1601-delete-many.sh b/t/t1601-delete-many.sh\nindex 8648ed1..8eff308 100755\n--- a/t/t1601-delete-many.sh\n+++ b/t/t1601-delete-many.sh\n@@ -10,13 +10,13 @@ test_expect_success \\\n test_expect_success \\\n     'Create five applied and five unapplied patches' \\\n     '\n-    stg new foo0 -m foo0 &&\n-    echo foo0 > foo.txt &&\n+    stg new p0 -m p0 &&\n+    echo p0 > foo.txt &&\n     stg add foo.txt &&\n     stg refresh &&\n     for i in 1 2 3 4 5 6 7 8 9; do\n-        stg new foo$i -m foo$i &&\n-        echo foo$i >> foo.txt &&\n+        stg new p$i -m p$i &&\n+        echo p$i >> foo.txt &&\n         stg refresh;\n     done &&\n     stg pop -n 5\n@@ -25,31 +25,31 @@ test_expect_success \\\n test_expect_success \\\n     'Delete some patches' \\\n     '\n-    [ $(stg applied | wc -l) -eq 5 ] &&\n-    [ $(stg unapplied | wc -l) -eq 5 ] &&\n-    stg delete foo7 foo6 foo3 foo4 &&\n-    [ $(stg applied | wc -l) -eq 3 ] &&\n-    [ $(stg unapplied | wc -l) -eq 3 ]\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2 p3 p4\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p5 p6 p7 p8 p9\" ] &&\n+    stg delete p7 p6 p3 p4 &&\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p5 p8 p9\" ]\n     '\n \n test_expect_success \\\n     'Delete some more patches, some of which do not exist' \\\n     '\n-    [ $(stg applied | wc -l) -eq 3 ] &&\n-    [ $(stg unapplied | wc -l) -eq 3 ] &&\n-    ! stg delete foo7 foo8 foo2 foo0 &&\n-    [ $(stg applied | wc -l) -eq 3 ] &&\n-    [ $(stg unapplied | wc -l) -eq 3 ]\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p5 p8 p9\" ] &&\n+    ! stg delete p7 p8 p2 p0 &&\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p5 p8 p9\" ]\n     '\n \n test_expect_success \\\n     'Delete a range of patches' \\\n     '\n-    [ $(stg applied | wc -l) -eq 3 ] &&\n-    [ $(stg unapplied | wc -l) -eq 3 ] &&\n-    stg delete foo1..foo8 &&\n-    [ $(stg applied | wc -l) -eq 1 ] &&\n-    [ $(stg unapplied | wc -l) -eq 1 ]\n+    [ \"$(echo $(stg applied))\" = \"p0 p1 p2\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p5 p8 p9\" ] &&\n+    stg delete p1..p8 &&\n+    [ \"$(echo $(stg applied))\" = \"p0\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p9\" ]\n     '\n \n test_done\n"},{"id":"42038","messageId":"20070513182725.18810.85322.stgit@yoghurt","threadId":"8134","inReplyTo":"20070513182720.18810.64330.stgit@yoghurt","subject":"[StGIT PATCH 2/3] Test patch order, not just number of patches","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-13T18:27:25Z","receivedAt":"2007-05-13T18:27:25Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nIn addition to testing the number of applied patches, also test their\norder. And test the order of unapplied patches too while we're at it.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n t/t2000-sync.sh |   37 +++++++++++++++++++++++++++----------\n 1 files changed, 27 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t2000-sync.sh b/t/t2000-sync.sh\nindex 02345bb..69ab1ac 100755\n--- a/t/t2000-sync.sh\n+++ b/t/t2000-sync.sh\n@@ -29,7 +29,9 @@ test_expect_success \\\n     stg add foo3.txt &&\n     stg refresh &&\n     stg export &&\n-    stg pop\n+    stg pop &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p3\" ]\n     '\n \n test_expect_success \\\n@@ -38,15 +40,17 @@ test_expect_success \\\n     stg branch -c foo base &&\n     stg new p1 -m p1 &&\n     stg new p2 -m p2 &&\n-    stg new p3 -m p3\n-    test $(stg applied -c) -eq 3\n+    stg new p3 -m p3 &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ]\n     '\n \n test_expect_success \\\n     'Synchronise second patch with the master branch' \\\n     '\n     stg sync -b master p2 &&\n-    test $(stg applied -c) -eq 3 &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ] &&\n     test $(cat foo2.txt) = \"foo2\"\n     '\n \n@@ -54,7 +58,8 @@ test_expect_success \\\n     'Synchronise the first two patches with the master branch' \\\n     '\n     stg sync -b master -a &&\n-    test $(stg applied -c) -eq 3 &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ] &&\n     test $(cat foo1.txt) = \"foo1\" &&\n     test $(cat foo2.txt) = \"foo2\"\n     '\n@@ -63,7 +68,8 @@ test_expect_success \\\n     'Synchronise all the patches with the exported series' \\\n     '\n     stg sync -s patches-master/series -a &&\n-    test $(stg applied -c) -eq 3 &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ] &&\n     test $(cat foo1.txt) = \"foo1\" &&\n     test $(cat foo2.txt) = \"foo2\" &&\n     test $(cat foo3.txt) = \"foo3\"\n@@ -73,6 +79,8 @@ test_expect_success \\\n     'Modify the master patches' \\\n     '\n     stg branch master &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p3\" ] &&\n     stg goto p1 &&\n     echo bar1 >> foo1.txt &&\n     stg refresh &&\n@@ -83,6 +91,8 @@ test_expect_success \\\n     stg goto p3 &&\n     echo bar3 >> foo3.txt &&\n     stg refresh &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ] &&\n     stg export &&\n     stg branch foo\n     '\n@@ -91,7 +101,8 @@ test_expect_success \\\n     'Synchronise second patch with the master branch' \\\n     '\n     stg sync -b master p2 &&\n-    test $(stg applied -c) -eq 3 &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ] &&\n     test $(cat bar2.txt) = \"bar2\"\n     '\n \n@@ -104,10 +115,13 @@ test_expect_failure \\\n test_expect_success \\\n     'Restore the stack status after the failed sync' \\\n     '\n-    test $(stg applied -c) -eq 1 &&\n+    [ \"$(echo $(stg applied))\" = \"p1\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"p2 p3\" ] &&\n     stg resolved -a &&\n     stg refresh &&\n     stg goto p3\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ]\n     '\n \n test_expect_failure \\\n@@ -119,9 +133,12 @@ test_expect_failure \\\n test_expect_success \\\n     'Restore the stack status after the failed sync' \\\n     '\n-    test $(stg applied -c) -eq 3 &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ] &&\n     stg resolved -a &&\n-    stg refresh\n+    stg refresh &&\n+    [ \"$(echo $(stg applied))\" = \"p1 p2 p3\" ] &&\n+    [ \"$(echo $(stg unapplied))\" = \"\" ]\n     '\n \n test_done\n"},{"id":"42037","messageId":"20070513182730.18810.72629.stgit@yoghurt","threadId":"8134","inReplyTo":"20070513182720.18810.64330.stgit@yoghurt","subject":"[StGIT PATCH 3/3] Use \"stg applied\" instead of reading the applied file directly","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-13T18:27:30Z","receivedAt":"2007-05-13T18:27:30Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\n\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n t/t1500-float.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1500-float.sh b/t/t1500-float.sh\nindex dbcd8ce..814c9bd 100755\n--- a/t/t1500-float.sh\n+++ b/t/t1500-float.sh\n@@ -20,37 +20,37 @@ test_expect_success \\\n \t stg new F -m \"f\" && echo F >f.txt && stg add f.txt && stg refresh &&\n \t stg new G -m \"g\" && echo G >g.txt && stg add g.txt && stg refresh &&\n \t stg pop &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"A B C D E F\"\n+\t test \"$(echo $(stg applied))\" = \"A B C D E F\"\n \t'\n \n test_expect_success \\\n \t'Float A to top' \\\n \t'stg float A &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"B C D E F A\"\n+\t test \"$(echo $(stg applied))\" = \"B C D E F A\"\n \t'\n test_expect_success \\\n \t'Float A to top (noop)' \\\n \t'stg float A &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"B C D E F A\"\n+\t test \"$(echo $(stg applied))\" = \"B C D E F A\"\n \t'\n test_expect_success \\\n \t'Float B C to top' \\\n \t'stg float B C &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"D E F A B C\"\n+\t test \"$(echo $(stg applied))\" = \"D E F A B C\"\n \t'\n test_expect_success \\\n \t'Float E A to top' \\\n \t'stg float E A &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"D F B C E A\"\n+\t test \"$(echo $(stg applied))\" = \"D F B C E A\"\n \t'\n test_expect_success \\\n \t'Float E to top' \\\n \t'stg float E &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"D F B C A E\"\n+\t test \"$(echo $(stg applied))\" = \"D F B C A E\"\n \t'\n test_expect_success \\\n \t'Float G F to top' \\\n \t'stg float G F &&\n-\t test \"`echo \\`cat .git/patches/master/applied\\``\" = \"D B C A E G F\"\n+\t test \"$(echo $(stg applied))\" = \"D B C A E G F\"\n \t'\n test_done\n"}]}