summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-z_slow/leak_heredoc1.tests
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-z_slow/leak_heredoc1.tests')
-rwxr-xr-xshell/hush_test/hush-z_slow/leak_heredoc1.tests34
1 files changed, 34 insertions, 0 deletions
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 0000000..26cbb28
--- /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