diff options
Diffstat (limited to 'test/gsubasgn.awk')
-rw-r--r-- | test/gsubasgn.awk | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/gsubasgn.awk b/test/gsubasgn.awk new file mode 100644 index 00000000..f0b77012 --- /dev/null +++ b/test/gsubasgn.awk @@ -0,0 +1,13 @@ +# tests for assigning to a function within that function + +#1 - should be bad +function test1 (r) { gsub(r, "x", test1) } +BEGIN { test1("") } + +#2 - should be bad +function test2 () { gsub(/a/, "x", test2) } +BEGIN { test2() } + +#3 - should be ok +function test3 (r) { gsub(/a/, "x", r) } +BEGIN { test3("") } |