1#!/bin/sh 2 3. libtest.sh 4. libgit.sh 5 6export LINES=22 7 8tigrc <<EOF 9set vertical-split = no 10EOF 11 12test_setup_work_dir() { 13 create_dirty_workdir 14 mkdir dir-a dir-b dir-c 15 for i in $(seq 1 5); do 16 touch "root.$i" 17 done 18 for i in $(seq 1 3); do 19 touch "dir-a/aa.$i" 20 done 21 for i in $(seq 1 1); do 22 touch "dir-b/bb.$i" 23 done 24} 25 26test_case 'initial' \ 27 --args='status' \ 28<<EXPECTED_SCREEN 29On branch master 30Changes to be committed: 31 (no files) 32Changes not staged for commit: 33M .j 34M a 35M b.c 36M e/f 37M g h 38Untracked files: 39? dir-a/aa.1 40? dir-a/aa.2 41? dir-a/aa.3 42? dir-b/bb.1 43? root.1 44? root.2 45? root.3 46? root.4 47? root.5 48 49[status] Nothing to update 100% 50EXPECTED_SCREEN 51 52test_case 'inside-dir-a' \ 53 --args='status' \ 54 --cwd='dir-a' \ 55<<EXPECTED_SCREEN 56On branch master 57Changes to be committed: 58 (no files) 59Changes not staged for commit: 60M .j 61M a 62M b.c 63M e/f 64M g h 65Untracked files: 66? dir-a/aa.1 67? dir-a/aa.2 68? dir-a/aa.3 69? dir-b/bb.1 70? root.1 71? root.2 72? root.3 73? root.4 74? root.5 75 76[status] Nothing to update 100% 77EXPECTED_SCREEN 78 79test_case 'status-show-untracked-files-option-off' \ 80 --args='status' \ 81 --script=':toggle status-show-untracked-files' \ 82<<EXPECTED_SCREEN 83On branch master 84Changes to be committed: 85 (no files) 86Changes not staged for commit: 87M .j 88M a 89M b.c 90M e/f 91M g h 92Untracked files: 93 (not shown) 94 95 96 97 98 99 100 101 102 103[status] Nothing to update 100% 104EXPECTED_SCREEN 105 106run_test_cases 107