Skip to content

Commit

Permalink
Avoid depending on wcwidth in test by removing Variation Selector
Browse files Browse the repository at this point in the history
test/main/emoji-test fails when using a recent version of glibc, where
wcwidth(πŸ›) equals 2 (used to be 1 which is less correct).

This test used to include πŸ› and other emoji followed by the 
["Variation Selector"](https://unicode-table.com/en/FE0F/).

With the old wcwidth, Tig would render both characters, one cell each.
With the new wcwidth, Tig only renders the first one twice, in two cells.

As a result, the output of :save-display varies across systems.  Solving this
is not really in scope for Tig, since this is the domain of wcwidth and
Ncurses. Hence, remove the variation selectors. As far as I can tell they
are useless here anyway because the characters render the same way after
removing them.
  • Loading branch information
krobelus committed Jan 9, 2021
1 parent 5bab1c0 commit 4614ce4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/main/emoji-test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test_setup_work_dir()
git_commit -m "🎨 Reformat the code"
git_commit -m "πŸ“š Document new feature"
git_commit -m "πŸ’„ Polish the UI"
git_commit -m "πŸŒπŸ’§βœ‹πŸ•‹πŸ—‘πŸš€πŸœβ˜€οΈπŸŒ‘πŸŒΆπŸ’―πŸš±β³πŸŒ…πŸŒ‘πŸ˜‘πŸ’‰πŸ˜±πŸ˜ˆπŸ’€πŸ’₯πŸŒ›πŸŒ™πŸ­πŸ’₯πŸšΆπŸ»γ€°πŸ›οΈβŒ›οΈπŸ‘³πŸ™πŸ’₯πŸ˜΄πŸ›ŒπŸ˜³πŸ’₯πŸ›πŸ’₯πŸ‘Šβš”πŸ‘‘ "
git_commit -m "πŸŒπŸ’§βœ‹πŸ•‹πŸ—‘πŸš€πŸœβ˜€πŸŒ‘πŸŒΆπŸ’―πŸš±β³πŸŒ…πŸŒ‘πŸ˜‘πŸ’‰πŸ˜±πŸ˜ˆπŸ’€πŸ’₯πŸŒ›πŸŒ™πŸ­πŸ’₯πŸšΆπŸ»γ€°πŸ›βŒ›πŸ‘³πŸ™πŸ’₯πŸ˜΄πŸ›ŒπŸ˜³πŸ’₯πŸ›πŸ’₯πŸ‘Šβš”πŸ‘‘ "
}

git_init
Expand All @@ -37,35 +37,35 @@ test_case emoji-commit-titles-col-46 \
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linu
2009-02-13 23:31 +0000 Committer I πŸš‘ Fix bug
[main] 50a10e108b44c34548b9ba9e318416b3027100%
[main] 237d747db3f85d2ae36127ecd0371feb4ca100%
EOF

test_case emoji-commit-titles-col-unset \
--subshell='unset COLUMNS' \
<<EOF
2009-04-06 01:44 +0000 Committer o [master] πŸŒπŸ’§βœ‹πŸ•‹πŸ—‘πŸš€πŸœβ˜€οΈπŸŒ‘πŸŒΆπŸ’―πŸš±β³πŸŒ…πŸŒ‘πŸ˜‘πŸ’‰πŸ˜±πŸ˜ˆπŸ’€
2009-04-06 01:44 +0000 Committer o [master] πŸŒπŸ’§βœ‹πŸ•‹πŸ—‘πŸš€πŸœβ˜€πŸŒ‘πŸŒΆπŸ’―πŸš±β³πŸŒ…πŸŒ‘πŸ˜‘πŸ’‰πŸ˜±πŸ˜ˆπŸ’€
2009-03-28 13:22 +0000 Committer o πŸ’„ Polish the UI
2009-03-20 01:00 +0000 Committer o πŸ“š Document new feature
2009-03-11 12:38 +0000 Committer o 🎨 Reformat the code
2009-03-03 00:15 +0000 Committer o ✨ Add new feature
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linux issue
2009-02-13 23:31 +0000 Committer I πŸš‘ Fix bug
[main] 50a10e108b44c34548b9ba9e318416b3027a0627 - commit 1 of 7 100%
[main] 237d747db3f85d2ae36127ecd0371feb4ca986e3 - commit 1 of 7 100%
EOF

test_case emoji-commit-titles-col-300 \
--subshell='export COLUMNS=300' \
<<EOF
2009-04-06 01:44 +0000 Committer o [master] πŸŒπŸ’§βœ‹πŸ•‹πŸ—‘πŸš€πŸœβ˜€οΈπŸŒ‘πŸŒΆπŸ’―πŸš±β³πŸŒ…πŸŒ‘πŸ˜‘πŸ’‰πŸ˜±πŸ˜ˆπŸ’€πŸ’₯πŸŒ›πŸŒ™πŸ­πŸ’₯πŸšΆπŸ»γ€°πŸ›οΈβŒ›οΈπŸ‘³πŸ™πŸ’₯πŸ˜΄πŸ›ŒπŸ˜³πŸ’₯πŸ›πŸ’₯πŸ‘Šβš”πŸ‘‘
2009-04-06 01:44 +0000 Committer o [master] πŸŒπŸ’§βœ‹πŸ•‹πŸ—‘πŸš€πŸœβ˜€πŸŒ‘πŸŒΆπŸ’―πŸš±β³πŸŒ…πŸŒ‘πŸ˜‘πŸ’‰πŸ˜±πŸ˜ˆπŸ’€πŸ’₯πŸŒ›πŸŒ™πŸ­πŸ’₯πŸšΆπŸ»γ€°πŸ›βŒ›πŸ‘³πŸ™πŸ’₯πŸ˜΄πŸ›ŒπŸ˜³πŸ’₯πŸ›πŸ’₯πŸ‘Šβš”πŸ‘‘
2009-03-28 13:22 +0000 Committer o πŸ’„ Polish the UI
2009-03-20 01:00 +0000 Committer o πŸ“š Document new feature
2009-03-11 12:38 +0000 Committer o 🎨 Reformat the code
2009-03-03 00:15 +0000 Committer o ✨ Add new feature
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linux issue
2009-02-13 23:31 +0000 Committer I πŸš‘ Fix bug
[main] 50a10e108b44c34548b9ba9e318416b3027a0627 - commit 1 of 7 100%
[main] 237d747db3f85d2ae36127ecd0371feb4ca986e3 - commit 1 of 7 100%
EOF

run_test_cases

0 comments on commit 4614ce4

Please sign in to comment.