enhanced a special form FS to affect record reading in bytes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -24,7 +24,8 @@ check_ERRORS = e-001.err
|
||||
##noinst_SCRIPTS = $(check_SCRIPTS)
|
||||
EXTRA_DIST = $(check_SCRIPTS) $(check_ERRORS) tap.inc err.sh \
|
||||
journal-toc.hawk journal-toc.in journal-toc.out journal-toc-html.out \
|
||||
bibtex-to-html.hawk bibtex-to-html.out
|
||||
bibtex-to-html.hawk bibtex-to-html.out \
|
||||
fs-test.hawk fs-test.in fs-test.out
|
||||
|
||||
check_PROGRAMS = t-001 t-002 t-003 t-004 t-005 t-006 t-007 t-008 t-009
|
||||
|
||||
|
@ -648,7 +648,8 @@ check_SCRIPTS = $(am__append_1) h-003.hawk h-004.hawk h-009.hawk
|
||||
check_ERRORS = e-001.err
|
||||
EXTRA_DIST = $(check_SCRIPTS) $(check_ERRORS) tap.inc err.sh \
|
||||
journal-toc.hawk journal-toc.in journal-toc.out journal-toc-html.out \
|
||||
bibtex-to-html.hawk bibtex-to-html.out
|
||||
bibtex-to-html.hawk bibtex-to-html.out \
|
||||
fs-test.hawk fs-test.in fs-test.out
|
||||
|
||||
t_001_SOURCES = t-001.c tap.h
|
||||
t_001_CPPFLAGS = $(CPPFLAGS_COMMON)
|
||||
|
9
t/fs-test.hawk
Normal file
9
t/fs-test.hawk
Normal file
@ -0,0 +1,9 @@
|
||||
BEGIN {
|
||||
## `FS` with a question mark(`?`) followed by four characters. the last three are equal.
|
||||
FS="?,\"\"\"";
|
||||
}
|
||||
|
||||
{
|
||||
for (i = 0; i <= NF; i++) print i, "[" $i "]";
|
||||
}
|
||||
|
8
t/fs-test.in
Normal file
8
t/fs-test.in
Normal file
@ -0,0 +1,8 @@
|
||||
"Product ID","Product Name","Description","Price","Available Sizes","Notes"
|
||||
101,"Deluxe Widget","A versatile widget for various applications. Features include:
|
||||
- Enhanced durability
|
||||
- Multi-functional design
|
||||
- Easy to use",29.99,"Small,Medium,Large","Customer feedback suggests excellent performance."
|
||||
102,"Super Gadget","The ultimate gadget for tech enthusiasts.",49.99,"One Size","Limited stock, order soon!"
|
||||
103,"Basic Tool Set","A comprehensive set of essential tools, including a hammer, screwdriver, and wrench.
|
||||
Perfect for home DIY projects.",35.50,"N/A","Tools are made from high-quality steel."
|
36
t/fs-test.out
Normal file
36
t/fs-test.out
Normal file
@ -0,0 +1,36 @@
|
||||
0 ["Product ID","Product Name","Description","Price","Available Sizes","Notes"]
|
||||
1 [Product ID]
|
||||
2 [Product Name]
|
||||
3 [Description]
|
||||
4 [Price]
|
||||
5 [Available Sizes]
|
||||
6 [Notes]
|
||||
0 [101,"Deluxe Widget","A versatile widget for various applications. Features include:
|
||||
- Enhanced durability
|
||||
- Multi-functional design
|
||||
- Easy to use",29.99,"Small,Medium,Large","Customer feedback suggests excellent performance."]
|
||||
1 [101]
|
||||
2 [Deluxe Widget]
|
||||
3 [A versatile widget for various applications. Features include:
|
||||
- Enhanced durability
|
||||
- Multi-functional design
|
||||
- Easy to use]
|
||||
4 [29.99]
|
||||
5 [Small,Medium,Large]
|
||||
6 [Customer feedback suggests excellent performance.]
|
||||
0 [102,"Super Gadget","The ultimate gadget for tech enthusiasts.",49.99,"One Size","Limited stock, order soon!"]
|
||||
1 [102]
|
||||
2 [Super Gadget]
|
||||
3 [The ultimate gadget for tech enthusiasts.]
|
||||
4 [49.99]
|
||||
5 [One Size]
|
||||
6 [Limited stock, order soon!]
|
||||
0 [103,"Basic Tool Set","A comprehensive set of essential tools, including a hammer, screwdriver, and wrench.
|
||||
Perfect for home DIY projects.",35.50,"N/A","Tools are made from high-quality steel."]
|
||||
1 [103]
|
||||
2 [Basic Tool Set]
|
||||
3 [A comprehensive set of essential tools, including a hammer, screwdriver, and wrench.
|
||||
Perfect for home DIY projects.]
|
||||
4 [35.50]
|
||||
5 [N/A]
|
||||
6 [Tools are made from high-quality steel.]
|
21
t/h-003.hawk
21
t/h-003.hawk
@ -10,7 +10,7 @@ function are_files_identical(a, b)
|
||||
f1 = sys::open(a, sys::O_RDONLY);
|
||||
if (f1 <= -1)
|
||||
{
|
||||
printf ("ERROR: unable to open %s\n", a);
|
||||
printf("ERROR: unable to open %s\n", a);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ function are_files_identical(a, b)
|
||||
if (f2 <= -1)
|
||||
{
|
||||
sys::close (a);
|
||||
printf ("ERROR: unable to open %s\n", b);
|
||||
printf("ERROR: unable to open %s\n", b);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -34,8 +34,8 @@ function are_files_identical(a, b)
|
||||
|
||||
if (sys::read(f2, y, 1) > 0) diff = 1;
|
||||
|
||||
sys::close (f2);
|
||||
sys::close (f1);
|
||||
sys::close(f2);
|
||||
sys::close(f1);
|
||||
return !diff;
|
||||
}
|
||||
|
||||
@ -66,20 +66,21 @@ function run_test (x, more_opts, in_name, set_out_name, out_name)
|
||||
if (same <= 0)
|
||||
{
|
||||
## don't delete the output file for review.
|
||||
tap_fail (sprintf("%s[%d] %s - %s and %s differ", @SCRIPTNAME, @SCRIPTLINE, x, expf, outf));
|
||||
tap_fail(sprintf("%s[%d] %s - %s and %s differ", @SCRIPTNAME, @SCRIPTLINE, x, expf, outf));
|
||||
}
|
||||
else
|
||||
{
|
||||
tap_ok (sprintf("%s[%d]", @SCRIPTNAME, @SCRIPTLINE));
|
||||
sys::unlink (outf);
|
||||
tap_ok(sprintf("%s[%d]", @SCRIPTNAME, @SCRIPTLINE));
|
||||
sys::unlink(outf);
|
||||
}
|
||||
}
|
||||
|
||||
function main()
|
||||
{
|
||||
run_test ("journal-toc", "", @nil, 0, @nil);
|
||||
run_test ("journal-toc", "-vHTML=1", "journal-toc", 0, "journal-toc-html");
|
||||
run_test ("bibtex-to-html", "", "journal-toc", 1, "bibtex-to-html");
|
||||
run_test("journal-toc", "", @nil, 0, @nil);
|
||||
run_test("journal-toc", "-vHTML=1", "journal-toc", 0, "journal-toc-html");
|
||||
run_test("bibtex-to-html", "", "journal-toc", 1, "bibtex-to-html");
|
||||
run_test("fs-test", "", "fs-test", 0, "fs-test");
|
||||
|
||||
tap_end ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user