ladybird/Userland/Shell/Tests/builtin-test.sh
Ali Mohammad Pur 55914841b7 Shell/Tests: Replace 'type f -f' with 'type -f f'
The order of arguments seemed be confusing ArgsParser.
Fixes #6467.
2021-04-19 10:07:58 +02:00

25 lines
683 B
Bash

#!/bin/sh
source $(dirname "$0")/test-commons.inc
if not [ "$(type ls)" = "ls is $(which ls)" ] { fail "'type' on a binary not working" }
if not [ "$(type pwd)" = "pwd is a shell builtin" ] { fail "'type' on a builtin not working" }
f() { ls }
if not [ "$(type f)" = "f is a function f() { ls }" ] { fail "'type' on a function not working" }
if not [ "$(type -f f)" = "f is a function" ] { fail "'type' on a function not working with -f" }
alias l=ls
if not [ "$(type l)" = "l is aliased to `ls`" ] { fail "'type' on a alias not working" }
if not [ "$(type l ls)" = "l is aliased to `ls` ls is $(which ls)" ] { fail "'type' on multiple commands not working" }
echo PASS