Set fish_emoji_width in test to guard against older wcwidth

See #7340
This commit is contained in:
Johannes Altmanninger 2020-09-28 17:53:27 +02:00
parent dfcb4b811c
commit 3002c88f44

View file

@ -54,19 +54,21 @@ string pad --width 7 -c '=' foo
echo \|(string pad --width 10 --right foo)\|
# CHECK: |foo |
begin
set -l fish_emoji_width 2
# Pad string with multi-width emoji.
string pad -w 4 -c . 🐟
# NOTE: These are regex'd because the testing system might have an older/newer wcwidth.
# CHECK: .{{.*}}🐟
# CHECK: ..🐟
# Pad with multi-width character.
string pad -w 3 -c 🐟 .
# CHECK: {{🐟+}}.
# CHECK: 🐟.
# Multi-width pad with remainder, complemented with a space.
string pad -w 4 -c 🐟 k kk
# CHECK: {{🐟+}} k
# CHECK: {{🐟+}}kk
string pad -w 4 -c 🐟 . ..
# CHECK: 🐟 .
# CHECK: 🐟..
end
# Pad to the maximum length.
string pad -c . long longer longest