diff options
Diffstat (limited to 'Test')
-rw-r--r-- | Test/B03print.ztst | 17 | ||||
-rw-r--r-- | Test/D04parameter.ztst | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/Test/B03print.ztst b/Test/B03print.ztst index e36e55caa..c3ba42b18 100644 --- a/Test/B03print.ztst +++ b/Test/B03print.ztst @@ -263,3 +263,20 @@ printf '%b\n' '\0123' 0:printf handles \0... octal escapes in replacement text >S + + print -lO $'a' $'a\0' $'a\0b' $'a\0b\0' $'a\0b\0a' $'a\0b\0b' $'a\0c' | + while read -r line; do + for (( i = 1; i <= ${#line}; i++ )); do + foo=$line[i] + printf "%02x" $(( #foo )) + done + print + done +0:sorting with embedded nulls +>610063 +>6100620062 +>6100620061 +>61006200 +>610062 +>6100 +>61 diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index a2613dc1f..1caed4479 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -886,3 +886,20 @@ >/one >/ >/ + + nully=($'a\0c' $'a\0b\0b' $'a\0b\0a' $'a\0b\0' $'a\0b' $'a\0' $'a') + for string in ${(o)nully}; do + for (( i = 1; i <= ${#string}; i++ )); do + foo=$string[i] + printf "%02x" $(( #foo )) + done + print + done +0:Sorting arrays with embedded nulls +>61 +>6100 +>610062 +>61006200 +>6100620061 +>6100620062 +>610063 |