Annotation of researchv10no/cmd/gre/regress.d/simple, revision 1.1

1.1     ! root        1: awk '
        !             2: BEGIN {
        !             3:        sq = "'"'"'"
        !             4:        FS = "\t"
        !             5:        gre = "'"$GRE"'"
        !             6: }
        !             7: NF == 0 {
        !             8:        next
        !             9: }
        !            10: $1 != "" {     # new test
        !            11:        re = $1
        !            12:        if($4 == ""){
        !            13:                nopts = 1; opts[0] = ""
        !            14:        } else if(substr($4, 1, 1) == "-"){
        !            15:                nopts = 1; opts[0] = " " $4
        !            16:        } else {
        !            17:                for(nopts = 0; nopts < length($4); nopts++){
        !            18:                        x = substr($4, nopts, 1)
        !            19:                        if(x == "~") opts[nopts] = ""
        !            20:                        else opts[nopts] = " -" x
        !            21:                }
        !            22:        }
        !            23: }
        !            24: $2 != "" {     # either ~ or !~
        !            25:        op = $2
        !            26:        if (op == "~")
        !            27:                neg = 0
        !            28:        else if (op == "!~")
        !            29:                neg = 1
        !            30: }
        !            31: $3 != "" {     # new test string
        !            32:        str = $3
        !            33: }
        !            34: $3 == "\"\"" { # explicit empty line
        !            35:        $3 = ""
        !            36: }
        !            37: NF > 2 {       # generate a test
        !            38:        input = $3
        !            39:        for(i = 0; i < nopts; i++){
        !            40:        ntests++;
        !            41:        if(neg){
        !            42:                printf("if echo %s | %s -s %s; then echo %s%d fails %s %s %s %s%s ;else :; fi\n", sq input sq, gre opts[i], sq re sq, sq, NR, opts[i], re, op, input, sq)
        !            43:        } else {
        !            44:                printf("if echo %s | %s -s %s; then :; else echo %s%d fails %s %s %s %s%s ; fi\n", sq input sq, gre opts[i], sq re sq, sq, NR, opts[i], re, op, input, sq)
        !            45:        }
        !            46:        }
        !            47: }
        !            48: END    { print "echo " sq ntests " simple tests" sq }
        !            49: ' > regress.i <<\!!!
        !            50: a      ~       a
        !            51:                ba
        !            52:                bab
        !            53:        !~      ""
        !            54:                x
        !            55:                xxxxx
        !            56: .      ~       x
        !            57:                xxx
        !            58:        !~      ""                      
        !            59: .a     ~       xa
        !            60:                xxa
        !            61:                xax
        !            62:        !~      a
        !            63:                ab
        !            64:                ""
        !            65: $      ~       x
        !            66:                ""
        !            67: .$     ~       x
        !            68:        !~      ""
        !            69: a$     ~       a
        !            70:                ba
        !            71:                bbba
        !            72:        !~      ab
        !            73:                x
        !            74:                ""
        !            75: ^      ~       x
        !            76:                ""
        !            77:                ^
        !            78: ^a$    ~       a
        !            79:        !~      xa
        !            80:                ax
        !            81:                xax
        !            82:                ""
        !            83: ^a.$   ~       ax
        !            84:                aa
        !            85:        !~      xa
        !            86:                aaa
        !            87:                axy
        !            88:                ""
        !            89: ^$     ~       ""
        !            90:        !~      x
        !            91:                ^
        !            92: ^.a    ~       xa
        !            93:                xaa
        !            94:        !~      a
        !            95:                ""
        !            96: ^.*a   ~       a
        !            97:                xa
        !            98:                xxxxxxa
        !            99:        !~      ""
        !           100: ^.+a   ~       xa
        !           101:                xxxxxxa
        !           102:        !~      ""
        !           103:                a
        !           104:                ax
        !           105: a*     ~       ""
        !           106:                a
        !           107:                aaaa
        !           108:                xa
        !           109:                xxxx
        !           110: aa*    ~       a
        !           111:                aaa
        !           112:                xa
        !           113:        !~      xxxx
        !           114:                ""
        !           115: \$     ~       x$
        !           116:                $
        !           117:                $x
        !           118:        !~      ""
        !           119:                x
        !           120: \.     ~       .
        !           121:        !~      x
        !           122:                ""
        !           123: .^$    ~       a^      -G
        !           124:        !~      ""
        !           125:                a^$
        !           126: ^x$    ~       x       -G
        !           127:        !~      yx
        !           128:                xy
        !           129: a\$    ~       a$      -G
        !           130:        !~      a
        !           131: \(ab\)$        ~       cab     -G
        !           132:                ab
        !           133:        !~      ab$
        !           134: xr+y   ~       xry     ~E
        !           135:                xrry
        !           136:                xrrrrrry
        !           137:        !~      ry
        !           138:                xy
        !           139: xr?y   ~       xy      ~E
        !           140:                xry
        !           141:        !~      xrry
        !           142: a(bc|def)g     ~       abcg    ~E
        !           143:                adefg
        !           144:        !~      abc
        !           145:                abg
        !           146:                adef
        !           147:                adeg
        !           148: [0-9]  ~       1
        !           149:                567
        !           150:                x0y
        !           151:        !~      abc
        !           152:                ""
        !           153: [^0-9] !~      1
        !           154:                567
        !           155:                ""
        !           156:        ~       abc
        !           157:                x0y
        !           158: x[0-9]+y       ~       x0y     ~E
        !           159:                x23y
        !           160:                x12345y
        !           161:        !~      0y
        !           162:                xy
        !           163: x[0-9]?y       ~       xy      ~E
        !           164:                x1y
        !           165:        !~      x23y
        !           166: X      ~       x       -i
        !           167: read   ~       read    -x
        !           168:        !~      xy read
        !           169:                x read y
        !           170:                xread
        !           171:                readx
        !           172: read   ~       read    -xF
        !           173:        !~      xy read
        !           174:                x read y
        !           175:                xread
        !           176:                readx
        !           177: read   ~       read    -F
        !           178:                xy read
        !           179:                x read y
        !           180:                xread
        !           181:                readx
        !           182: [.]de..        ~       .dexx
        !           183:                .deyyy
        !           184:        !~      .de
        !           185:                .dex
        !           186: ^|s    ~       |sec    -G
        !           187:        !~      sec
        !           188: ..B    ~       CDAB    -G
        !           189:        !~      ABCD
        !           190: $.*tt.*\$      ~       $tt$    -G
        !           191: ^([a-z]+)\1$   ~       vivi
        !           192:        !~      vivify
        !           193: ([a-z]+)\1     ~       vivi
        !           194:                vivify
        !           195:                revivi
        !           196:        !~      vovify
        !           197:                viv
        !           198: \(....\).*\1   ~       beriberi        -G
        !           199: (....).*\1     ~       beriberi
        !           200: ^$     ~       
        !           201: ^$     ~               -G
        !           202: [ab]\{2\}k     ~       abk
        !           203:                xyaak
        !           204:                zabak
        !           205:        !~      zad
        !           206:                bq
        !           207:                abq
        !           208: [ab]\{2,\}d    ~       abd
        !           209:                abababad
        !           210:        !~      ad
        !           211:                ababaq
        !           212: q[ab]\{2,4\}d  ~       qabd
        !           213:                qababd
        !           214:                qaaad
        !           215:        !~      qad
        !           216:                qababad
        !           217: a[]]b  ~       a]b     -E
        !           218: a[]]b  ~       a]b     -G
        !           219: a[^]b]c        ~       adc     -E
        !           220: a[^]b]c        ~       adc     -G
        !           221: angel[^e]      ~       angelo  -i
        !           222:        ~       ANGELH
        !           223:        !~      angel
        !           224:                ANGEL
        !           225:                angele
        !           226:                ANGELE
        !           227: ^[^-].*>       ~       abc>    -G
        !           228:        !~      -a>
        !           229: ^[A-Z] ~       abc     -i
        !           230:                ABC
        !           231: ^[^A-Z]        !~      abc     -i
        !           232:                ABC
        !           233:        ~       123
        !           234: |abc   ~       |abc    -G
        !           235:        !~      abc
        !           236: \(ac*\)c*d[ac]*\1      ~       acdacaaa        -G
        !           237: (ac*)c*d[ac]*\1        ~       acdacaaa
        !           238: ram|am ~       am
        !           239: .|..   !~      abc     -x
        !           240: [a-za-za-za-za-za-za-za-za-za-z]       ~       for this line   -E
        !           241: [a-za-za-za-za-za-za-za-za-za-z]       ~       for this line
        !           242: [a-za-za-za-za-za-za-za-za-z]  ~       but watch out   -E
        !           243: [a-za-za-za-za-za-za-za-za-z]  ~       but watch out
        !           244: !!!
        !           245: cp regress.i ../temp
        !           246: sh < regress.i && rm regress.i
        !           247: echo "verified simple"

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.