mksh/tests/glob.t
tg a34b05d2e6 Import OpenBSD 3.3 source repository from CTM 3132 the first time
This opens an OpenBSD-mirabile (aka MirBSD) repository.

### MirBSD is:
# Copyright (c) 1982-2003 by Thorsten "mirabile" Glaser <x86@ePost.de>
# Copyright © 1968-2003  The authors of And contributors to UNIX®, the
#       C Language, BSD/Berkeley Unix; 386BSD, NetBSD 1.1 and OpenBSD.
#
# Anyone who obtained a copy of this work is hereby permitted to freely use,
# distribute, modify, merge, sublicence, give away or sell it as long as the
# authors are given due credit and the following notice is retained:
#
# This work is provided "as is", with no explicit or implicit warranty what-
# soever. Use it only at your own risk. In no event may an author or contri-
# butor be held liable for any damage, directly or indirectly, that origina-
# ted through or is caused by creation or modification of this work.

MirBSD is my private tree. MirBSD does not differ very much from OpenBSD
and intentionally tracks OpenBSD. That's why it _is_ OpenBSD, just not the
official one. It's like with DarrenBSD.

At time of this writing, no advertising for MirBSD must be done,
because the advertising clause has not yet been sorted out.

http://templeofhate.com/tglaser/MirBSD/index.php
2003-03-22 17:35:03 +00:00

100 lines
1.6 KiB
Perl

name: glob-bad-1
description:
Check that globbing isn't done when glob has syntax error
file-setup: dir 755 "[x"
file-setup: file 644 "[x/foo"
stdin:
echo [*
echo *[x
echo [x/*
expected-stdout:
[*
*[x
[x/foo
---
name: glob-bad-2
description:
Check that symbolic links aren't stat()'d
category: !os:os2
file-setup: dir 755 "dir"
file-setup: symlink 644 "dir/abc"
non-existant-file
stdin:
echo d*/*
echo d*/abc
expected-stdout:
dir/abc
dir/abc
---
name: glob-range-1
description:
Test range matching
file-setup: file 644 ".bc"
file-setup: file 644 "abc"
file-setup: file 644 "bbc"
file-setup: file 644 "cbc"
file-setup: file 644 "-bc"
stdin:
echo [ab-]*
echo [-ab]*
echo [!-ab]*
echo [!ab]*
echo []ab]*
expected-stdout:
-bc abc bbc
-bc abc bbc
cbc
-bc cbc
abc bbc
---
name: glob-range-2
description:
Test range matching
(at&t ksh fails this; POSIX says invalid)
file-setup: file 644 "abc"
stdin:
echo [a--]*
expected-stdout:
[a--]*
---
name: glob-range-3
description:
Check that globbing matches the right things...
file-setup: file 644 "aÂc"
stdin:
echo a[Á-Ú]*
expected-stdout:
aÂc
---
name: glob-range-4
description:
Results unspecified according to POSIX
file-setup: file 644 ".bc"
stdin:
echo [a.]*
expected-stdout:
[a.]*
---
name: glob-range-5
description:
Results unspecified according to POSIX
(at&t ksh treats this like [a-cc-e]*)
file-setup: file 644 "abc"
file-setup: file 644 "bbc"
file-setup: file 644 "cbc"
file-setup: file 644 "dbc"
file-setup: file 644 "ebc"
file-setup: file 644 "-bc"
stdin:
echo [a-c-e]*
expected-stdout:
-bc abc bbc cbc ebc
---