Skip to content

Commit e5d5e79

Browse files
committed
improve present-removed-lines test
1 parent f1c3dd8 commit e5d5e79

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

test/bugs.bats

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ load 'test_helper/bats-support/load'
44
load 'test_helper/bats-assert/load'
55
load 'test_helper/util'
66

7-
8-
output=$( load_fixture "chromium-modaltoelement" | $diff_so_fancy )
9-
10-
11-
empty_remove_highlight=""
12-
137
# https://github.com/paulirish/dotfiles/commit/6743b907ff586c28cd36e08d1e1c634e2968893e#commitcomment-13459061
148
@test "All removed lines are present in diff" {
15-
assert_output --partial "WebInspector.Dialog = function($empty_remove_highlight)"
16-
assert_output --partial "show: function($empty_remove_highlight)"
17-
assert_output --partial "{!Document} */ (WebInspector.Dialog._modalHostView.element.ownerDocument$empty_remove_highlight)"
9+
output=$( load_fixture "chromium-modaltoelement" | $diff_so_fancy )
10+
run printf "%s" "$output"
11+
12+
assert_line --index 7 --partial "WebInspector.Dialog"
13+
assert_line --index 7 --partial "5;52m" # red oldhighlight
14+
assert_line --index 8 --partial "WebInspector.Dialog"
15+
assert_line --index 8 --partial "5;22m" # green newhighlight
1816
}
1917

2018
@test "File with space in the name (#360)" {
@@ -28,6 +26,6 @@ empty_remove_highlight=""
2826
output=$( load_fixture "add_remove_empty_lines" | $diff_so_fancy )
2927
run printf "%s" "$output"
3028

31-
assert_line --index 5 --partial "[7m[1;32"
32-
assert_line --index 8 --partial "[7m[1;31"
29+
assert_line --index 5 --partial "[7m[1;32" # green added line
30+
assert_line --index 8 --partial "[7m[1;31" # red removed line
3331
}

0 commit comments

Comments
 (0)