xref: /freebsd-src/contrib/one-true-awk/bugs-fixed/subsep-overflow.awk (revision 0269ae4c19ad779b43b0d6e2416ac7386945d692)
1*b5253557SWarner Loshfunction foo(c, n) {
2*b5253557SWarner Losh    s = "";
3*b5253557SWarner Losh    for (i = 0; i < n; i++) {
4*b5253557SWarner Losh        s = s c;
5*b5253557SWarner Losh    }
6*b5253557SWarner Losh    return s;
7*b5253557SWarner Losh}
8*b5253557SWarner Losh
9*b5253557SWarner LoshBEGIN {
10*b5253557SWarner Losh    str1 = foo("a", 4500);
11*b5253557SWarner Losh    str2 = foo("b", 9000);
12*b5253557SWarner Losh
13*b5253557SWarner Losh    a[(SUBSEP = str1), (SUBSEP = str2), "c"] = 1;
14*b5253557SWarner Losh
15*b5253557SWarner Losh    for (k in a) {
16*b5253557SWarner Losh        print length(k);
17*b5253557SWarner Losh    }
18*b5253557SWarner Losh
19*b5253557SWarner Losh    print (((SUBSEP = str1), (SUBSEP = str2), "c") in a);
20*b5253557SWarner Losh    print (((SUBSEP = str1) SUBSEP (SUBSEP = str2) SUBSEP "c") in a);
21*b5253557SWarner Losh    delete a[(SUBSEP = str1), (SUBSEP = str2), "c"];
22*b5253557SWarner Losh    print (((SUBSEP = str1), (SUBSEP = str2), "c") in a);
23*b5253557SWarner Losh    print (((SUBSEP = str1) SUBSEP (SUBSEP = str2) SUBSEP "c") in a);
24*b5253557SWarner Losh}
25