mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
This brings in Unicode support, CSV support and a number of bug fixes. They are described in _The AWK Programming Language_, Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger (Addison-Wesley, 2024, ISBN-13 978-0138269722, ISBN-10 0138269726). Sponsored by: Netflix (cherry picked from commit f32a6403d34654ac6e61182d09abb5e85850e1ee)
1.5 KiB
Executable file
1.5 KiB
Executable file
| 1 | #!/bin/sh |
|---|---|
| 2 | echo T.csv: tests of csv field splitting, no embedded newlines |
| 3 | awk=${awk-../a.out} |
| 4 | $awk ' |
| 5 | BEGIN { |
| 6 | } |
| 7 | NF == 0 || $1 ~ /^#/ { |
| 8 | next |
| 9 | } |
| 10 | $1 ~ /try/ { # new test |
| 11 | nt++ |
| 12 | prog = $0 |
| 13 | nt2 = 0 |
| 14 | while (getline > 0) { |
| 15 | if (NF == 0) # blank line terminates a sequence |
| 16 | break |
| 17 | input = $1 |
| 18 | input, prog) |
| 19 | else |
| 20 | nt, ++nt2) |
| 21 | system(test output run) |
| 22 | } |
| 23 | tt += nt2 |
| 24 | } |
| 25 | ' <<\!!!! |
| 26 | # General format: |
| 27 | # try program as rest of line |
| 28 | # $1 $2 $3 output1 (\t for tab, \n for newline, |
| 29 | # ... terminated by blank line |
| 30 | a [a] |
| 31 | a [ a] |
| 32 | ,a [][a] |
| 33 | , a [ ][ a] |
| 34 | a,b [a][b] |
| 35 | a,b,c [a][b][c] |
| 36 | a''b [a''b] |
| 37 | ,, [][][] |
| 38 | a, [a][] |
| 39 | , [][] |
| 40 | !!!! |