split and adapt some testcases for EBCDIC
This commit is contained in:
parent
46865d7fc8
commit
515df6ab7c
189
check.t
189
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.787 2017/05/01 19:44:26 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.788 2017/05/03 16:17:08 tg Exp $
|
||||||
# -*- mode: sh -*-
|
# -*- mode: sh -*-
|
||||||
#-
|
#-
|
||||||
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
@ -2325,6 +2325,7 @@ expected-stdout:
|
|||||||
name: eglob-utf8-1
|
name: eglob-utf8-1
|
||||||
description:
|
description:
|
||||||
UTF-8 mode differences for eglobbing
|
UTF-8 mode differences for eglobbing
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
s=blöd
|
s=blöd
|
||||||
set +U
|
set +U
|
||||||
@ -2765,6 +2766,7 @@ expected-stdout:
|
|||||||
name: heredoc-10
|
name: heredoc-10
|
||||||
description:
|
description:
|
||||||
Check direct here document assignment
|
Check direct here document assignment
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
x=u
|
x=u
|
||||||
va=<<EOF
|
va=<<EOF
|
||||||
@ -2817,6 +2819,62 @@ expected-stdout:
|
|||||||
} |
|
} |
|
||||||
| vapp1^vapp2^ |
|
| vapp1^vapp2^ |
|
||||||
---
|
---
|
||||||
|
name: heredoc-10-ebcdic
|
||||||
|
description:
|
||||||
|
Check direct here document assignment
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
x=u
|
||||||
|
va=<<EOF
|
||||||
|
=a $x \x7C=
|
||||||
|
EOF
|
||||||
|
vb=<<'EOF'
|
||||||
|
=b $x \x7C=
|
||||||
|
EOF
|
||||||
|
function foo {
|
||||||
|
vc=<<-EOF
|
||||||
|
=c $x \x7C=
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
fnd=$(typeset -f foo)
|
||||||
|
print -r -- "$fnd"
|
||||||
|
function foo {
|
||||||
|
echo blub
|
||||||
|
}
|
||||||
|
foo
|
||||||
|
eval "$fnd"
|
||||||
|
foo
|
||||||
|
# rather nonsensical, but…
|
||||||
|
vd=<<<"=d $x \x7C="
|
||||||
|
ve=<<<'=e $x \x7C='
|
||||||
|
vf=<<<$'=f $x \x7C='
|
||||||
|
# now check
|
||||||
|
print -r -- "| va={$va} vb={$vb} vc={$vc} vd={$vd} ve={$ve} vf={$vf} |"
|
||||||
|
# check append
|
||||||
|
v=<<-EOF
|
||||||
|
vapp1
|
||||||
|
EOF
|
||||||
|
v+=<<-EOF
|
||||||
|
vapp2
|
||||||
|
EOF
|
||||||
|
print -r -- "| ${v//$'\n'/^} |"
|
||||||
|
expected-stdout:
|
||||||
|
function foo {
|
||||||
|
vc=<<-EOF
|
||||||
|
=c $x \x7C=
|
||||||
|
EOF
|
||||||
|
|
||||||
|
}
|
||||||
|
blub
|
||||||
|
| va={=a u \x7C=
|
||||||
|
} vb={=b $x \x7C=
|
||||||
|
} vc={=c u \x7C=
|
||||||
|
} vd={=d u \x7C=
|
||||||
|
} ve={=e $x \x7C=
|
||||||
|
} vf={=f $x @=
|
||||||
|
} |
|
||||||
|
| vapp1^vapp2^ |
|
||||||
|
---
|
||||||
name: heredoc-11
|
name: heredoc-11
|
||||||
description:
|
description:
|
||||||
Check here documents with no or empty delimiter
|
Check here documents with no or empty delimiter
|
||||||
@ -5104,18 +5162,34 @@ expected-stdout:
|
|||||||
2 :10/8,16: .
|
2 :10/8,16: .
|
||||||
3 :10/10,16: .
|
3 :10/10,16: .
|
||||||
---
|
---
|
||||||
name: integer-base-check-numeric-from
|
name: integer-base-check-numeric-from-1
|
||||||
description:
|
description:
|
||||||
Check behaviour for base one to 36, and that 37 degrades to 10
|
Check behaviour for base one
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
echo 1:$((1#1))0.
|
echo 1:$((1#1))0.
|
||||||
|
expected-stdout:
|
||||||
|
1:490.
|
||||||
|
---
|
||||||
|
name: integer-base-check-numeric-from-1-ebcdic
|
||||||
|
description:
|
||||||
|
Check behaviour for base one
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
echo 1:$((1#1))0.
|
||||||
|
expected-stdout:
|
||||||
|
1:2410.
|
||||||
|
---
|
||||||
|
name: integer-base-check-numeric-from-2
|
||||||
|
description:
|
||||||
|
Check behaviour for base two to 36, and that 37 degrades to 10
|
||||||
|
stdin:
|
||||||
i=1
|
i=1
|
||||||
while (( ++i <= 37 )); do
|
while (( ++i <= 37 )); do
|
||||||
eval 'echo '$i':$(('$i'#10)).'
|
eval 'echo '$i':$(('$i'#10)).'
|
||||||
done
|
done
|
||||||
echo 37:$($__progname -c 'echo $((37#10))').$?:
|
echo 37:$($__progname -c 'echo $((37#10))').$?:
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
1:490.
|
|
||||||
2:2.
|
2:2.
|
||||||
3:3.
|
3:3.
|
||||||
4:4.
|
4:4.
|
||||||
@ -5154,18 +5228,41 @@ expected-stdout:
|
|||||||
37:10.
|
37:10.
|
||||||
37:10.0:
|
37:10.0:
|
||||||
---
|
---
|
||||||
name: integer-base-check-numeric-to
|
name: integer-base-check-numeric-to-1
|
||||||
description:
|
description:
|
||||||
Check behaviour for base one to 36, and that 37 degrades to 10
|
Check behaviour for base one
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
i=0
|
i=1
|
||||||
|
typeset -Uui$i x=0x40
|
||||||
|
eval "typeset -i10 y=$x"
|
||||||
|
print $i:$x.$y.
|
||||||
|
expected-stdout:
|
||||||
|
1:1#@.64.
|
||||||
|
---
|
||||||
|
name: integer-base-check-numeric-to-1-ebcdic
|
||||||
|
description:
|
||||||
|
Check behaviour for base one
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
i=1
|
||||||
|
typeset -Uui$i x=0x7C
|
||||||
|
eval "typeset -i10 y=$x"
|
||||||
|
print $i:$x.$y.
|
||||||
|
expected-stdout:
|
||||||
|
1:1#@.124.
|
||||||
|
---
|
||||||
|
name: integer-base-check-numeric-to-2
|
||||||
|
description:
|
||||||
|
Check behaviour for base two to 36, and that 37 degrades to 10
|
||||||
|
stdin:
|
||||||
|
i=1
|
||||||
while (( ++i <= 37 )); do
|
while (( ++i <= 37 )); do
|
||||||
typeset -Uui$i x=0x40
|
typeset -Uui$i x=0x40
|
||||||
eval "typeset -i10 y=$x"
|
eval "typeset -i10 y=$x"
|
||||||
print $i:$x.$y.
|
print $i:$x.$y.
|
||||||
done
|
done
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
1:1#@.64.
|
|
||||||
2:2#1000000.64.
|
2:2#1000000.64.
|
||||||
3:3#2101.64.
|
3:3#2101.64.
|
||||||
4:4#1000.64.
|
4:4#1000.64.
|
||||||
@ -8303,7 +8400,7 @@ description:
|
|||||||
multibyte character of the shell input (with -c, from standard
|
multibyte character of the shell input (with -c, from standard
|
||||||
input, as file, or as eval argument), but nowhere else
|
input, as file, or as eval argument), but nowhere else
|
||||||
# breaks on Mac OSX (HFS+ non-standard Unicode canonical decomposition)
|
# breaks on Mac OSX (HFS+ non-standard Unicode canonical decomposition)
|
||||||
category: !os:darwin
|
category: !os:darwin,!shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
mkdir foo
|
mkdir foo
|
||||||
print '#!/bin/sh\necho ohne' >foo/fnord
|
print '#!/bin/sh\necho ohne' >foo/fnord
|
||||||
@ -8360,7 +8457,7 @@ description:
|
|||||||
note: Ultrix perl5 t4 returns 65280 (exit-code 255) and no text
|
note: Ultrix perl5 t4 returns 65280 (exit-code 255) and no text
|
||||||
XXX fails when LD_PRELOAD is set with -e and Perl chokes it (ASan)
|
XXX fails when LD_PRELOAD is set with -e and Perl chokes it (ASan)
|
||||||
need-pass: no
|
need-pass: no
|
||||||
category: !os:cygwin,!os:msys,!os:ultrix,!os:uwin-nt,!smksh
|
category: !os:cygwin,!os:msys,!os:ultrix,!os:uwin-nt,!smksh,!shell:ebcdic-yes
|
||||||
env-setup: !FOO=BAR!
|
env-setup: !FOO=BAR!
|
||||||
stdin:
|
stdin:
|
||||||
print '#!'"$__progname"'\nprint "1 a=$ENV{FOO}";' >t1
|
print '#!'"$__progname"'\nprint "1 a=$ENV{FOO}";' >t1
|
||||||
@ -9381,6 +9478,7 @@ expected-stdout:
|
|||||||
name: varexpand-special-hash
|
name: varexpand-special-hash
|
||||||
description:
|
description:
|
||||||
Check special ${var@x} expansion for x=hash
|
Check special ${var@x} expansion for x=hash
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
typeset -i8 foo=10
|
typeset -i8 foo=10
|
||||||
bar=baz
|
bar=baz
|
||||||
@ -9389,6 +9487,18 @@ stdin:
|
|||||||
expected-stdout:
|
expected-stdout:
|
||||||
9B15FBFB CFBDD32B 00000000 .
|
9B15FBFB CFBDD32B 00000000 .
|
||||||
---
|
---
|
||||||
|
name: varexpand-special-hash-ebcdic
|
||||||
|
description:
|
||||||
|
Check special ${var@x} expansion for x=hash
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
typeset -i8 foo=10
|
||||||
|
bar=baz
|
||||||
|
unset baz
|
||||||
|
print ${foo@#} ${bar@#} ${baz@#} .
|
||||||
|
expected-stdout:
|
||||||
|
016AE33D 9769C4AF 00000000 .
|
||||||
|
---
|
||||||
name: varexpand-special-quote
|
name: varexpand-special-quote
|
||||||
description:
|
description:
|
||||||
Check special ${var@Q} expansion for quoted strings
|
Check special ${var@Q} expansion for quoted strings
|
||||||
@ -10448,6 +10558,7 @@ expected-stdout:
|
|||||||
name: integer-base-one-5A
|
name: integer-base-one-5A
|
||||||
description:
|
description:
|
||||||
Check to see that we’re NUL and Unicode safe
|
Check to see that we’re NUL and Unicode safe
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
set +U
|
set +U
|
||||||
print 'a\0b\xfdz' >x
|
print 'a\0b\xfdz' >x
|
||||||
@ -10458,6 +10569,20 @@ stdin:
|
|||||||
expected-stdout:
|
expected-stdout:
|
||||||
16#61 16#0 16#62 16#FD 16#7A .
|
16#61 16#0 16#62 16#FD 16#7A .
|
||||||
---
|
---
|
||||||
|
name: integer-base-one-5E
|
||||||
|
description:
|
||||||
|
Check to see that we’re NUL and Unicode safe
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
set +U
|
||||||
|
print 'a\0b\xfdz' >x
|
||||||
|
read -a y <x
|
||||||
|
set -U
|
||||||
|
typeset -Uui16 y
|
||||||
|
print ${y[*]} .
|
||||||
|
expected-stdout:
|
||||||
|
16#81 16#0 16#82 16#FD 16#A9 .
|
||||||
|
---
|
||||||
name: integer-base-one-5W
|
name: integer-base-one-5W
|
||||||
description:
|
description:
|
||||||
Check to see that we’re NUL and Unicode safe
|
Check to see that we’re NUL and Unicode safe
|
||||||
@ -12555,12 +12680,23 @@ expected-stdout:
|
|||||||
name: echo-test-1
|
name: echo-test-1
|
||||||
description:
|
description:
|
||||||
Test what the echo builtin does (mksh)
|
Test what the echo builtin does (mksh)
|
||||||
|
category: !shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
echo -n 'foo\x40bar'
|
echo -n 'foo\x40bar'
|
||||||
echo -e '\tbaz'
|
echo -e '\tbaz'
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
foo@bar baz
|
foo@bar baz
|
||||||
---
|
---
|
||||||
|
name: echo-test-1-ebcdic
|
||||||
|
description:
|
||||||
|
Test what the echo builtin does (mksh)
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
echo -n 'foo\x7Cbar'
|
||||||
|
echo -e '\tbaz'
|
||||||
|
expected-stdout:
|
||||||
|
foo@bar baz
|
||||||
|
---
|
||||||
name: echo-test-2
|
name: echo-test-2
|
||||||
description:
|
description:
|
||||||
Test what the echo builtin does (POSIX)
|
Test what the echo builtin does (POSIX)
|
||||||
@ -12591,7 +12727,7 @@ expected-stdout:
|
|||||||
name: echo-test-3-normal
|
name: echo-test-3-normal
|
||||||
description:
|
description:
|
||||||
Test what the echo builtin does, and test a compatibility flag.
|
Test what the echo builtin does, and test a compatibility flag.
|
||||||
category: !mnbsdash
|
category: !mnbsdash,!shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
"$__progname" -c 'echo -n 1=\\x40$1; echo -e \\x2E' -- foo bar
|
"$__progname" -c 'echo -n 1=\\x40$1; echo -e \\x2E' -- foo bar
|
||||||
"$__progname" -o posix -c 'echo -n 2=\\x40$1; echo -e \\x2E' -- foo bar
|
"$__progname" -o posix -c 'echo -n 2=\\x40$1; echo -e \\x2E' -- foo bar
|
||||||
@ -12601,6 +12737,19 @@ expected-stdout:
|
|||||||
2=\x40foo-e \x2E
|
2=\x40foo-e \x2E
|
||||||
3=\x40foo-e \x2E
|
3=\x40foo-e \x2E
|
||||||
---
|
---
|
||||||
|
name: echo-test-3-ebcdic
|
||||||
|
description:
|
||||||
|
Test what the echo builtin does, and test a compatibility flag.
|
||||||
|
category: !mnbsdash,!shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
"$__progname" -c 'echo -n 1=\\x7C$1; echo -e \\x2E' -- foo bar
|
||||||
|
"$__progname" -o posix -c 'echo -n 2=\\x7C$1; echo -e \\x2E' -- foo bar
|
||||||
|
"$__progname" -o sh -c 'echo -n 3=\\x7C$1; echo -e \\x2E' -- foo bar
|
||||||
|
expected-stdout:
|
||||||
|
1=@foo.
|
||||||
|
2=\x7Cfoo-e \x2E
|
||||||
|
3=\x7Cfoo-e \x2E
|
||||||
|
---
|
||||||
name: utilities-getopts-1
|
name: utilities-getopts-1
|
||||||
description:
|
description:
|
||||||
getopts sets OPTIND correctly for unparsed option
|
getopts sets OPTIND correctly for unparsed option
|
||||||
@ -13036,7 +13185,7 @@ name: duffs-device
|
|||||||
description:
|
description:
|
||||||
Check that the compiler did not optimise-break them
|
Check that the compiler did not optimise-break them
|
||||||
(lex.c has got a similar one in SHEREDELIM)
|
(lex.c has got a similar one in SHEREDELIM)
|
||||||
category: !shell:faux-ebcdic
|
category: !shell:faux-ebcdic,!shell:ebcdic-yes
|
||||||
stdin:
|
stdin:
|
||||||
set +U
|
set +U
|
||||||
s=
|
s=
|
||||||
@ -13049,6 +13198,22 @@ stdin:
|
|||||||
expected-stdout:
|
expected-stdout:
|
||||||
typeset s=$'\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\021\022\023\024\025\026\027\030\031\032\E\034\035\036\037 !"#$%&\047()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\u00A0\u20AC\uFFFD\357\277\276\357\277\277\360\220\200\200.'
|
typeset s=$'\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\021\022\023\024\025\026\027\030\031\032\E\034\035\036\037 !"#$%&\047()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\u00A0\u20AC\uFFFD\357\277\276\357\277\277\360\220\200\200.'
|
||||||
---
|
---
|
||||||
|
name: duffs-device-ebcdic
|
||||||
|
description:
|
||||||
|
Check that the compiler did not optimise-break them
|
||||||
|
category: !shell:ebcdic-no
|
||||||
|
stdin:
|
||||||
|
set +U
|
||||||
|
s=
|
||||||
|
typeset -i1 i=0
|
||||||
|
while (( ++i < 256 )); do
|
||||||
|
s+=${i#1#}
|
||||||
|
done
|
||||||
|
#s+=$'\xC2\xA0\xE2\x82\xAC\xEF\xBF\xBD\xEF\xBF\xBE\xEF\xBF\xBF\xF0\x90\x80\x80.' #XXX
|
||||||
|
typeset -p s
|
||||||
|
expected-stdout:
|
||||||
|
typeset s=$'\001\002\003\004\t\006\007\010\011\012\v\f\r\016\017\020\021\022\023\024\n\b\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\E\050\051\052\053\054\055\056\a\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077 âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@\175="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿Ð[Þ®¬£¥·©§¶¼½¾Ý¨¯]´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ\377'
|
||||||
|
---
|
||||||
name: duffs-device-faux-EBCDIC
|
name: duffs-device-faux-EBCDIC
|
||||||
description:
|
description:
|
||||||
Check that the compiler did not optimise-break them
|
Check that the compiler did not optimise-break them
|
||||||
|
Loading…
x
Reference in New Issue
Block a user