Skip to content

Commit

Permalink
[test/spec] Adjust allowed failures
Browse files Browse the repository at this point in the history
We still have a few commits to go before tackling #955 and getting json
write working.

Add a few more tests
  • Loading branch information
Andy Chu committed Nov 25, 2021
1 parent ce8b881 commit 415fdd9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
2 changes: 2 additions & 0 deletions core/runtime.asdl
Expand Up @@ -9,6 +9,8 @@ module runtime
-- in 'local foo', rval is None
assign_arg = (string var_name, value? rval, int spid)

more_args = (ArgList? typed_args, BraceGroup? block)

-- note: could import 'builtin' from synthetic option_asdl
cmd_value =
Argv(string* argv, int* arg_spids, ArgList? typed_args, BraceGroup? block)
Expand Down
11 changes: 6 additions & 5 deletions spec/oil-word-eval.test.sh
Expand Up @@ -51,17 +51,18 @@ bool expr true
bool splice true
## END

#### echo $f (x) with space is syntax error
#### echo $f (x) with space is runtime error
shopt -s oil:basic
echo $identity (true)
## status: 2
## status: 1
## STDOUT:
## END

#### echo @f (x) with space is syntax error
#### echo @f (x) with space is runtime error
shopt -s oil:basic
echo @identity (['foo', 'bar'])
## status: 2
const a = %(a b)
echo @a (['foo', 'bar'])
## status: 1
## STDOUT:
## END

Expand Down
18 changes: 18 additions & 0 deletions test/parse-errors.sh
Expand Up @@ -655,11 +655,29 @@ proc_arg_list() {

_should-parse 'json write (x, y); echo hi'

# named arg
_should-parse '
json write (x, name = "value")
echo hi
'

# with block on same line
_oil-should-parse 'json write (x) { echo hi }'

# with block
_oil-should-parse '
json write (x) {
echo hi
}'

# multiple lines
_should-parse 'json write (
x,
y,
z
)'


# can't be empty
_oil-parse-error 'json write ()'
_oil-parse-error 'json write ( )'
Expand Down
4 changes: 2 additions & 2 deletions test/spec.sh
Expand Up @@ -904,7 +904,7 @@ oil-command-sub() {
}

oil-json() {
sh-spec spec/oil-json.test.sh --osh-failures-allowed 0 \
sh-spec spec/oil-json.test.sh --osh-failures-allowed 1 \
$OSH_LIST "$@"
}

Expand All @@ -925,7 +925,7 @@ oil-options() {
}

oil-word-eval() {
sh-spec spec/oil-word-eval.test.sh --osh-failures-allowed 0 \
sh-spec spec/oil-word-eval.test.sh --osh-failures-allowed 1 \
$OSH_LIST "$@"
}

Expand Down

0 comments on commit 415fdd9

Please sign in to comment.