File: t3500-hide-unhide.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (36 lines) | stat: -rwxr-xr-x 740 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

test_description='Test "stg hide" and "stg unhide"'

. ./test-lib.sh

test_expect_success 'Initialize stgit' '
    stg init
'

test_expect_success 'Attempt too few arguments' '
    command_error stg hide   2>&1 | grep -e "No patches specified" &&
    command_error stg unhide 2>&1 | grep -e "No patches specified"
'

test_expect_success 'Add some patches' '
    stg new -m p0 p0 &&
    stg new -m p1 p1 &&
    stg new -m p2 p2 &&
    stg hide p2
'

test_expect_success 'Hide already hidden patch' '
    stg hide p2
'

test_expect_success 'Attempt unhide non-hidden patch' '
    command_error stg unhide p0 2>&1 |
    grep -e "Patch \"p0\" not hidden"
'

test_expect_success 'Unhide hidden patch' '
    stg unhide p2
'

test_done