File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 3939 sudo apt -y update
4040 sudo apt -y install zsh fish shellcheck
4141 fi
42- curl -s https://bashunit.typeddevs.com/install.sh | bash -s 0.23.0
42+ curl -s https://bashunit.typeddevs.com/install.sh | bash -s beta
4343
4444 - name : Show version
4545 run : |
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ function set_up_before_script() {
4+ source bin/git-forgit
5+ }
6+
7+ # @data_provider provider_diff_lines
8+ function test_forgit_get_files_from_diff_line() {
9+ local -r input=" $1 "
10+ shift
11+ local -r expected=(" $@ " )
12+ local -a actual=()
13+ local i
14+
15+ while IFS= read -r line; do
16+ actual+=( " $line " )
17+ done < <( echo -n " $input " | _forgit_get_files_from_diff_line | xargs -0 -n 1 echo )
18+
19+ # Compare array sizes
20+ assert_same " ${# expected[@]} " " ${# actual[@]} "
21+
22+ # Compare array elements
23+ for i in " ${! expected[@]} " ; do
24+ assert_same " ${expected[i]} " " ${actual[i]} "
25+ done
26+ }
27+
28+ function provider_diff_lines() {
29+ data_set " [A] newfile" " newfile"
30+ data_set " [D] oldfile with spaces" " oldfile with spaces"
31+ data_set " [R100] file -> another file" " file" " another file"
32+ data_set " [M] \" file with\ttab.txt\" " " \" file with\ttab.txt\" "
33+ }
You can’t perform that action at this time.
0 commit comments