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