git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Regression test for "stg assimilate"

From
Karl Hasselström <kha@treskal.com>
Date
Oct 22, 2006, 13:08 UTC
Message-ID
<20061022130807.17015.77803.stgit@localhost>
In-Reply-To
<20061022130559.17015.51385.stgit@localhost>
From: Karl Hasselström <kha@treskal.com>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t1301-assimilate.sh |   86 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)
diff --git a/t/t1301-assimilate.sh b/t/t1301-assimilate.sh
new file mode 100755
index 0000000..26b263c
--- /dev/null
+++ b/t/t1301-assimilate.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+# Copyright (c) 2006 Karl Hasselström
+test_description='Test the assimilate command.'
+. ./test-lib.sh
+
+test_expect_success \
+    'Assimilate in a non-initialized repository' \
+    'stg assimilate'
+
+test_expect_success \
+    'Initialize the StGIT repository' \
+    'stg init'
+
+test_expect_success \
+    'Assimilate in a repository without patches' \
+    'stg assimilate'
+
+test_expect_success \
+    'Create a patch' \
+    '
+    stg new foo -m foo &&
+    echo foo > foo.txt &&
+    stg add foo.txt &&
+    stg refresh
+    '
+
+test_expect_success \
+    'Assimilate when there is nothing to do' \
+    'stg assimilate'
+
+test_expect_success \
+    'Create a GIT commit' \
+    '
+    echo bar > bar.txt &&
+    git add bar.txt &&
+    git commit -a -m bar
+    '
+
+test_expect_success \
+    'Assimilate one GIT commit' \
+    '
+    [ $(stg applied | wc -l) -eq 1 ] &&
+    stg assimilate &&
+    [ $(stg applied | wc -l) -eq 2 ]
+    '
+
+test_expect_success \
+    'Create three more GIT commits' \
+    '
+    echo one > numbers.txt &&
+    git add numbers.txt &&
+    git commit -a -m one &&
+    echo two >> numbers.txt &&
+    git commit -a -m two &&
+    echo three >> numbers.txt &&
+    git commit -a -m three
+    '
+
+test_expect_success \
+    'Assimilate three GIT commits' \
+    '
+    [ $(stg applied | wc -l) -eq 2 ] &&
+    stg assimilate &&
+    [ $(stg applied | wc -l) -eq 5 ]
+    '
+
+test_expect_success \
+    'Create a mege commit' \
+    '
+    git checkout -b br master^^ &&
+    echo woof > woof.txt &&
+    git add woof.txt &&
+    git commit -a -m woof &&
+    git checkout master &&
+    git pull . br
+    '
+
+test_expect_success \
+    'Try (and fail) to assimilate the merge commit' \
+    '
+    [ $(stg applied | wc -l) -eq 5 ] &&
+    ! stg assimilate &&
+    [ $(stg applied | wc -l) -eq 5 ]
+    '
+
+test_done
Previous: Karl Hasselström
Message 9 of 9 in “Resistance is futile; you _will_ be assimilated ...”
  1. 0/2 Resistance is futile; you _will_ be assimilated ...Karl Hasselström, Oct 22, 2006
  2. 1/2 New stg command: assimilateKarl Hasselström, Oct 22, 2006
  3. Petr BaudisOct 22, 2006
  4. Karl HasselströmOct 22, 2006
  5. Catalin MarinasOct 23, 2006
  6. Karl HasselströmOct 25, 2006
  7. Catalin MarinasOct 25, 2006
  8. Karl HasselströmOct 26, 2006
  9. 2/2 Regression test for "stg assimilate"Karl Hasselström, Oct 22, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.