Skip to content

Commit a4e569d

Browse files
authored
Avoid depending on wcwidth in test by removing Variation Selector (#1065)
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.
1 parent 25f1086 commit a4e569d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/main/emoji-test

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test_setup_work_dir()
2121
git_commit -m "🎨 Reformat the code"
2222
git_commit -m "📚 Document new feature"
2323
git_commit -m "💄 Polish the UI"
24-
git_commit -m "🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀💥🌛🌙🐭💥🚶🏻〰🐛️⌛️👳🙏💥😴🛌😳💥🐛💥👊⚔👑 "
24+
git_commit -m "🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀💥🌛🌙🐭💥🚶🏻〰🐛👳🙏💥😴🛌😳💥🐛💥👊⚔👑 "
2525
}
2626

2727
git_init
@@ -37,35 +37,35 @@ test_case emoji-commit-titles-col-46 \
3737
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linu
3838
2009-02-13 23:31 +0000 Committer I 🚑 Fix bug
3939
40-
[main] 50a10e108b44c34548b9ba9e318416b3027100%
40+
[main] 237d747db3f85d2ae36127ecd0371feb4ca100%
4141
EOF
4242

4343
test_case emoji-commit-titles-col-unset \
4444
--subshell='unset COLUMNS' \
4545
<<EOF
46-
2009-04-06 01:44 +0000 Committer o [master] 🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀
46+
2009-04-06 01:44 +0000 Committer o [master] 🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀
4747
2009-03-28 13:22 +0000 Committer o 💄 Polish the UI
4848
2009-03-20 01:00 +0000 Committer o 📚 Document new feature
4949
2009-03-11 12:38 +0000 Committer o 🎨 Reformat the code
5050
2009-03-03 00:15 +0000 Committer o ✨ Add new feature
5151
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linux issue
5252
2009-02-13 23:31 +0000 Committer I 🚑 Fix bug
5353
54-
[main] 50a10e108b44c34548b9ba9e318416b3027a0627 - commit 1 of 7 100%
54+
[main] 237d747db3f85d2ae36127ecd0371feb4ca986e3 - commit 1 of 7 100%
5555
EOF
5656

5757
test_case emoji-commit-titles-col-300 \
5858
--subshell='export COLUMNS=300' \
5959
<<EOF
60-
2009-04-06 01:44 +0000 Committer o [master] 🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀💥🌛🌙🐭💥🚶🏻〰🐛️⌛️👳🙏💥😴🛌😳💥🐛💥👊⚔👑
60+
2009-04-06 01:44 +0000 Committer o [master] 🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀💥🌛🌙🐭💥🚶🏻〰🐛👳🙏💥😴🛌😳💥🐛💥👊⚔👑
6161
2009-03-28 13:22 +0000 Committer o 💄 Polish the UI
6262
2009-03-20 01:00 +0000 Committer o 📚 Document new feature
6363
2009-03-11 12:38 +0000 Committer o 🎨 Reformat the code
6464
2009-03-03 00:15 +0000 Committer o ✨ Add new feature
6565
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linux issue
6666
2009-02-13 23:31 +0000 Committer I 🚑 Fix bug
6767
68-
[main] 50a10e108b44c34548b9ba9e318416b3027a0627 - commit 1 of 7 100%
68+
[main] 237d747db3f85d2ae36127ecd0371feb4ca986e3 - commit 1 of 7 100%
6969
EOF
7070

7171
run_test_cases

0 commit comments

Comments
 (0)