mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
parent
dfcb4b811c
commit
3002c88f44
1 changed files with 13 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue