From 9d861e46e62b46abec6cfb5b471cff1a4fe12c55 Mon Sep 17 00:00:00 2001 From: Peter Grayson Date: Fri, 27 Aug 2021 16:39:57 -0400 Subject: [PATCH] Normalize float tests' whitespace Signed-off-by: Peter Grayson --- t/t1500-float.sh | 202 +++++++++++++++++++++++++++---------------------------- 1 file changed, 99 insertions(+), 103 deletions(-) rewrite t/t1500-float.sh (87%) diff --git a/t/t1500-float.sh b/t/t1500-float.sh dissimilarity index 87% index 741d563..413b93f 100755 --- a/t/t1500-float.sh +++ b/t/t1500-float.sh @@ -1,103 +1,99 @@ -#!/bin/sh -# -# Copyright (c) 2006 Robin Rosenberg -# - -test_description='Test floating a number of patches to the top of the stack - -' - -. ./test-lib.sh - -test_expect_success \ - 'Initialize the StGit repository' \ - 'stg init && - stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh && - stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh && - stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh && - stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh && - stg new E -m "e" && echo E >e.txt && stg add e.txt && stg refresh && - stg new F -m "f" && echo F >f.txt && stg add f.txt && stg refresh && - stg new G -m "g" && echo G >g.txt && stg add g.txt && stg refresh && - stg pop && - test "$(echo $(stg series --applied --noprefix))" = "A B C D E F" - ' - -test_expect_success \ - 'Float A to top' \ - 'stg float A && - test "$(echo $(stg series --applied --noprefix))" = "B C D E F A" - ' -test_expect_success \ - 'Float A to top (noop)' \ - 'stg float A && - test "$(echo $(stg series --applied --noprefix))" = "B C D E F A" - ' -test_expect_success \ - 'Float B C to top' \ - 'stg float B C && - test "$(echo $(stg series --applied --noprefix))" = "D E F A B C" - ' -test_expect_success \ - 'Float E A to top' \ - 'stg float E A && - test "$(echo $(stg series --applied --noprefix))" = "D F B C E A" - ' -test_expect_success \ - 'Float E to top' \ - 'stg float E && - test "$(echo $(stg series --applied --noprefix))" = "D F B C A E" - ' -test_expect_success \ - 'Float G F to top' \ - 'stg float G F && - test "$(echo $(stg series --applied --noprefix))" = "D B C A E G F" - ' - -cat > series.txt < rev-series.txt <&1 | - grep -e "No patches to float" - ' -test_expect_success \ - 'Attempt float with series file and arguments' \ - 'command_error stg float --series series.txt A 2>&1 | - grep -e " cannot be used with --series" - ' -test_expect_success \ - 'Attempt float with no series file and no arguments' \ - 'command_error stg float 2>&1 | - grep -e "incorrect number of arguments" - ' - -test_done +#!/bin/sh +# +# Copyright (c) 2006 Robin Rosenberg +# + +test_description='Test floating a number of patches to the top of the stack + +' + +. ./test-lib.sh + +test_expect_success 'Initialize the StGit repository' ' + stg init && + stg new A -m "a" && echo A >a.txt && stg add a.txt && stg refresh && + stg new B -m "b" && echo B >b.txt && stg add b.txt && stg refresh && + stg new C -m "c" && echo C >c.txt && stg add c.txt && stg refresh && + stg new D -m "d" && echo D >d.txt && stg add d.txt && stg refresh && + stg new E -m "e" && echo E >e.txt && stg add e.txt && stg refresh && + stg new F -m "f" && echo F >f.txt && stg add f.txt && stg refresh && + stg new G -m "g" && echo G >g.txt && stg add g.txt && stg refresh && + stg pop && + test "$(echo $(stg series --applied --noprefix))" = "A B C D E F" +' + +test_expect_success 'Float A to top' ' + stg float A && + test "$(echo $(stg series --applied --noprefix))" = "B C D E F A" +' + +test_expect_success 'Float A to top (noop)' ' + stg float A && + test "$(echo $(stg series --applied --noprefix))" = "B C D E F A" +' + +test_expect_success 'Float B C to top' ' + stg float B C && + test "$(echo $(stg series --applied --noprefix))" = "D E F A B C" +' + +test_expect_success 'Float E A to top' ' + stg float E A && + test "$(echo $(stg series --applied --noprefix))" = "D F B C E A" +' + +test_expect_success 'Float E to top' ' + stg float E && + test "$(echo $(stg series --applied --noprefix))" = "D F B C A E" +' + +test_expect_success 'Float G F to top' ' + stg float G F && + test "$(echo $(stg series --applied --noprefix))" = "D B C A E G F" +' + +cat > series.txt < rev-series.txt <&1 | + grep -e "No patches to float" +' + +test_expect_success 'Attempt float with series file and arguments' ' + command_error stg float --series series.txt A 2>&1 | + grep -e " cannot be used with --series" +' + +test_expect_success 'Attempt float with no series file and no arguments' ' + command_error stg float 2>&1 | + grep -e "incorrect number of arguments" +' + +test_done -- 2.11.4.GIT