diff options
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-z_slow/leak_heredoc1.right | 3 | ||||
-rwxr-xr-x | shell/hush_test/hush-z_slow/leak_heredoc1.tests | 34 |
2 files changed, 37 insertions, 0 deletions
diff --git a/shell/hush_test/hush-z_slow/leak_heredoc1.right b/shell/hush_test/hush-z_slow/leak_heredoc1.right new file mode 100644 index 000000000..c6f0334f3 --- /dev/null +++ b/shell/hush_test/hush-z_slow/leak_heredoc1.right @@ -0,0 +1,3 @@ +Warm up +Measuring memory leak... +Ok diff --git a/shell/hush_test/hush-z_slow/leak_heredoc1.tests b/shell/hush_test/hush-z_slow/leak_heredoc1.tests new file mode 100755 index 000000000..26cbb28a4 --- /dev/null +++ b/shell/hush_test/hush-z_slow/leak_heredoc1.tests @@ -0,0 +1,34 @@ +echo "Warm up" +i=1 +while test $i != 99; do + : <<HERE +Hello $i `echo builtin_$i` +HERE + : $((i++)) +done + +memleak + +echo "Measuring memory leak..." +i=1 +while test $i != 99; do + : <<HERE +Hello $i `echo builtin_$i` +HERE + : $((i++)) +done +i=1 +while test $i != 99; do + : <<HERE +Hello $i `echo builtin_$i` +HERE + : $((i++)) +done + +memleak +kb=$? +if test $kb -le 4; then + echo Ok #$kb +else + echo "Bad: $kb kb (or more) leaked" +fi |