Skip to content

Commit

Permalink
[test/lint] Fix build.
Browse files Browse the repository at this point in the history
Add more test cases for tracing.
  • Loading branch information
Andy Chu committed Jan 12, 2021
1 parent c58b0ae commit 2c30111
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
3 changes: 1 addition & 2 deletions core/dev.py
Expand Up @@ -8,7 +8,6 @@
lvalue_e, lvalue__Named, lvalue__Indexed, lvalue__Keyed,
cmd_value__Assign
)
from _devbuild.gen.option_asdl import builtin_i
from _devbuild.gen.syntax_asdl import assign_op_e

from asdl import runtime
Expand All @@ -19,7 +18,7 @@
from osh import word_
from pylib import os_path
from mycpp import mylib
from mycpp.mylib import switch, tagswitch, iteritems
from mycpp.mylib import tagswitch, iteritems

import posix_ as posix

Expand Down
50 changes: 49 additions & 1 deletion demo/xtrace1.sh
Expand Up @@ -101,13 +101,14 @@ loop() {
for x in 1 \
2 \
3; do
echo $x; echo =$(echo {x}-)
echo $x; echo =$(echo {x}-)
done

i=0
while test $i -lt 3; do
echo $x; echo ${x}-
i=$((i+1))
if true; then continue; fi
done
}

Expand Down Expand Up @@ -157,4 +158,51 @@ atoms2() {
readonly r=4
}

compound() {
set -x

# Nothing for time
time sleep 0

# There is no tracing for () and {}
{ echo b1
echo b2
}

( echo c1
echo c2
)

# no tracing for if; just the conditions
if test -d /; then
echo yes
else
echo no
fi

# Hm this causes a concurrency problem.
# I think we want to buffer the line
ls | wc -l | sort

# There IS tracing for 'case' line
case foo in
fo*)
echo case
;;
*)
echo default
;;
esac

f() {
echo hi
}

}

oil_constructs() {
echo TODO
# BareDecl, VarDecl, PlaceMutation, Expr
}

"$@"

0 comments on commit 2c30111

Please sign in to comment.