1 package io.jawk.gawk;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.assertTrue;
27
28 import java.nio.file.Files;
29 import java.nio.file.Path;
30 import io.jawk.AwkTestSupport;
31 import org.junit.Test;
32
33
34
35
36
37
38 public class GawkOptionalFeatureIT extends AbstractGawkSuite {
39
40 @Test
41 public void test_defref() throws Exception {
42 skip("gawk's --lint diagnostics are not implemented by Jawk.");
43 }
44
45 @Test
46 public void test_escapebrace() throws Exception {
47 AwkTestSupport
48 .cliTest("GAWK escapebrace")
49 .argument("--posix")
50 .argument("-f", gawkFile("escapebrace.awk"))
51 .stdin(gawkText("escapebrace.in"))
52 .expectLines(gawkPath("escapebrace.ok"))
53 .expectExit(0)
54 .runAndAssert();
55 }
56
57 @Test
58 public void test_gsubtst3() throws Exception {
59 AwkTestSupport
60 .cliTest("GAWK gsubtst3")
61 .argument("-f", gawkFile("gsubtst3.awk"))
62 .stdin(gawkText("gsubtst3.in"))
63 .expectLines(gawkPath("gsubtst3.ok"))
64 .expectExit(0)
65 .runAndAssert();
66 }
67
68 @Test
69 public void test_litoct() throws Exception {
70 skip("gawk's --traditional mode is not implemented by Jawk.");
71 }
72
73 @Test
74 public void test_noeffect() throws Exception {
75 skip("gawk's --lint diagnostics are not implemented by Jawk.");
76 }
77
78 @Test
79 public void test_nofmtch() throws Exception {
80 skip("gawk's --lint diagnostics are not implemented by Jawk.");
81 }
82
83 @Test
84 public void test_nonl() throws Exception {
85 skip("gawk's --lint diagnostics are not implemented by Jawk.");
86 }
87
88 @Test
89 public void test_paramasfunc1() throws Exception {
90 skip(NON_ZERO_TRANSCRIPT_REASON);
91 }
92
93 @Test
94 public void test_paramasfunc2() throws Exception {
95 skip(NON_ZERO_TRANSCRIPT_REASON);
96 }
97
98 @Test
99 public void test_posix2008sub() throws Exception {
100 AwkTestSupport
101 .cliTest("GAWK posix2008sub")
102 .argument("--posix")
103 .argument("-f", gawkFile("posix2008sub.awk"))
104 .expectLines(gawkPath("posix2008sub.ok"))
105 .expectExit(0)
106 .runAndAssert();
107 }
108
109 @Test
110 public void test_posix_compare() throws Exception {
111 AwkTestSupport
112 .cliTest("GAWK posix_compare")
113 .argument("--locale", "en-US")
114 .argument("--posix")
115 .argument("-f", gawkFile("posix_compare.awk"))
116 .expectLines(gawkPath("posix_compare.ok"))
117 .expectExit(0)
118 .runAndAssert();
119 }
120
121 @Test
122 public void test_printf0() throws Exception {
123 AwkTestSupport
124 .cliTest("GAWK printf0")
125 .argument("--posix")
126 .argument("-f", gawkFile("printf0.awk"))
127 .expectLines(gawkPath("printf0.ok"))
128 .expectExit(0)
129 .runAndAssert();
130 }
131
132 @Test
133 public void test_rscompat() throws Exception {
134 skip("gawk's --traditional mode is not implemented by Jawk.");
135 }
136
137 @Test
138 public void test_status_close() throws Exception {
139 AwkTestSupport
140 .cliTest("GAWK status-close")
141 .argument("-f", gawkFile("status-close.awk"))
142 .expectLines(gawkPath("status-close.ok"))
143 .expectExit(0)
144 .runAndAssert();
145 }
146
147 @Test
148 public void test_tradanch() throws Exception {
149 skip("gawk's --traditional mode is not implemented by Jawk.");
150 }
151
152 @Test
153 public void test_uninit2() throws Exception {
154 skip("gawk's --lint diagnostics are not implemented by Jawk.");
155 }
156
157 @Test
158 public void test_uninit3() throws Exception {
159 skip("gawk's --lint diagnostics are not implemented by Jawk.");
160 }
161
162 @Test
163 public void test_uninit4() throws Exception {
164 skip("gawk's --lint diagnostics are not implemented by Jawk.");
165 }
166
167 @Test
168 public void test_uninit5() throws Exception {
169 skip("gawk's --lint diagnostics are not implemented by Jawk.");
170 }
171
172 @Test
173 public void test_uninitialized() throws Exception {
174 skip("gawk's --lint diagnostics are not implemented by Jawk.");
175 }
176
177 @Test
178 public void test_csv1() throws Exception {
179 skip("gawk's --csv mode is not implemented by Jawk.");
180 }
181
182 @Test
183 public void test_csv2() throws Exception {
184 skip("gawk's --csv mode is not implemented by Jawk.");
185 }
186
187 @Test
188 public void test_csv3() throws Exception {
189 skip("gawk's --csv mode is not implemented by Jawk.");
190 }
191
192 @Test
193 public void test_csvodd() throws Exception {
194 skip("gawk's --csv mode is not implemented by Jawk.");
195 }
196
197 @Test
198 public void test_dbugeval2() throws Exception {
199 skip("gawk's --debug mode is not implemented by Jawk.");
200 }
201
202 @Test
203 public void test_dbugeval3() throws Exception {
204 skip("gawk's --debug mode is not implemented by Jawk.");
205 }
206
207 @Test
208 public void test_dbugeval4() throws Exception {
209 skip("gawk's --debug mode is not implemented by Jawk.");
210 }
211
212 @Test
213 public void test_dbugtypedre1() throws Exception {
214 skip("gawk's --debug mode is not implemented by Jawk.");
215 }
216
217 @Test
218 public void test_dbugtypedre2() throws Exception {
219 skip("gawk's --debug mode is not implemented by Jawk.");
220 }
221
222 @Test
223 public void test_forcenum() throws Exception {
224 AwkTestSupport
225 .cliTest("GAWK forcenum")
226 .argument("-f", gawkFile("forcenum.awk"))
227 .expectLines(gawkPath("forcenum.ok"))
228 .expectExit(0)
229 .runAndAssert();
230 }
231
232 @Test
233 public void test_intarray() throws Exception {
234 AwkTestSupport
235 .cliTest("GAWK intarray")
236 .argument("-f", gawkFile("intarray.awk"))
237 .expectLines(gawkPath("intarray.ok"))
238 .expectExit(0)
239 .runAndAssert();
240 }
241
242 @Test
243 public void test_lintexp() throws Exception {
244 skip("gawk's --lint diagnostics are not implemented by Jawk.");
245 }
246
247 @Test
248 public void test_lintindex() throws Exception {
249 skip("gawk's --lint diagnostics are not implemented by Jawk.");
250 }
251
252 @Test
253 public void test_lintint() throws Exception {
254 skip("gawk's --lint diagnostics are not implemented by Jawk.");
255 }
256
257 @Test
258 public void test_lintlength() throws Exception {
259 skip("gawk's --lint diagnostics are not implemented by Jawk.");
260 }
261
262 @Test
263 public void test_lintold() throws Exception {
264 skip("gawk's --lint-old diagnostics are not implemented by Jawk.");
265 }
266
267 @Test
268 public void test_lintplus() throws Exception {
269 skip("gawk's --lint diagnostics are not implemented by Jawk.");
270 }
271
272 @Test
273 public void test_lintwarn() throws Exception {
274 skip("gawk's --lint diagnostics are not implemented by Jawk.");
275 }
276
277 @Test
278 public void test_muldimposix() throws Exception {
279 skip(NON_ZERO_TRANSCRIPT_REASON);
280 }
281
282 @Test
283 public void test_nondec2() throws Exception {
284 AwkTestSupport
285 .cliTest("GAWK nondec2")
286 .argument("-f", gawkFile("nondec2.awk"))
287 .expectLines(gawkPath("nondec2.ok"))
288 .expectExit(0)
289 .runAndAssert();
290 }
291
292 @Test
293 public void test_nsprof1() throws Exception {
294 skip("gawk's --pretty-print mode is not implemented by Jawk.");
295 }
296
297 @Test
298 public void test_nsprof2() throws Exception {
299 skip("gawk's --pretty-print mode is not implemented by Jawk.");
300 }
301
302 @Test
303 public void test_profile4() throws Exception {
304 skip("gawk's --pretty-print mode is not implemented by Jawk.");
305 }
306
307 @Test
308 public void test_profile8() throws Exception {
309 skip("gawk's --pretty-print mode is not implemented by Jawk.");
310 }
311
312 @Test
313 public void test_profile9() throws Exception {
314 skip("gawk's --pretty-print mode is not implemented by Jawk.");
315 }
316
317 @Test
318 public void test_profile10() throws Exception {
319 skip("gawk's --pretty-print mode is not implemented by Jawk.");
320 }
321
322 @Test
323 public void test_profile11() throws Exception {
324 skip("gawk's --pretty-print mode is not implemented by Jawk.");
325 }
326
327 @Test
328 public void test_profile13() throws Exception {
329 skip("gawk's --pretty-print mode is not implemented by Jawk.");
330 }
331
332 @Test
333 public void test_profile14() throws Exception {
334 skip("gawk's --pretty-print mode is not implemented by Jawk.");
335 }
336
337 @Test
338 public void test_profile15() throws Exception {
339 skip("gawk's --pretty-print mode is not implemented by Jawk.");
340 }
341
342 @Test
343 public void test_profile16() throws Exception {
344 skip("gawk's --pretty-print mode is not implemented by Jawk.");
345 }
346
347 @Test
348 public void test_profile17() throws Exception {
349 skip("gawk's --pretty-print mode is not implemented by Jawk.");
350 }
351
352 @Test
353 public void test_reint() throws Exception {
354 AwkTestSupport
355 .cliTest("GAWK reint")
356 .argument("-f", gawkFile("reint.awk"))
357 .stdin(gawkText("reint.in"))
358 .expectLines(gawkPath("reint.ok"))
359 .expectExit(0)
360 .runAndAssert();
361 }
362
363 @Test
364 public void test_reint2() throws Exception {
365 AwkTestSupport
366 .cliTest("GAWK reint2")
367 .argument("--locale", "en-US")
368 .argument("-f", gawkFile("reint2.awk"))
369 .stdin(gawkText("reint2.in"))
370 .expectLines(gawkPath("reint2.ok"))
371 .expectExit(0)
372 .runAndAssert();
373 }
374
375 @Test
376 public void test_sandbox1() throws Exception {
377 skip(NON_ZERO_TRANSCRIPT_REASON);
378 }
379
380 @Test
381 public void test_shadow() throws Exception {
382 skip("gawk's --lint diagnostics are not implemented by Jawk.");
383 }
384
385 @Test
386 public void test_double1() throws Exception {
387 AwkTestSupport
388 .cliTest("GAWK double1")
389 .argument("-f", gawkFile("double1.awk"))
390 .expectLines(gawkPath("double1.ok"))
391 .expectExit(0)
392 .runAndAssert();
393 }
394
395 @Test
396 public void test_double2() throws Exception {
397 AwkTestSupport
398 .cliTest("GAWK double2")
399 .argument("-f", gawkFile("double2.awk"))
400 .expectLines(gawkPath("double2.ok"))
401 .expectExit(0)
402 .runAndAssert();
403 }
404
405 @Test
406 public void test_inf_nan_torture() throws Exception {
407 AwkTestSupport
408 .cliTest("GAWK inf-nan-torture")
409 .argument("-f", gawkFile("inf-nan-torture.awk"))
410 .stdin(gawkText("inf-nan-torture.in"))
411 .expectLines(gawkPath("inf-nan-torture.ok"))
412 .expectExit(0)
413 .runAndAssert();
414 }
415
416 @Test
417 public void test_intformat() throws Exception {
418 AwkTestSupport
419 .cliTest("GAWK intformat")
420 .argument("-f", gawkFile("intformat.awk"))
421 .expectLines(gawkPath("intformat.ok"))
422 .expectExit(0)
423 .runAndAssert();
424 }
425
426 @Test
427 public void test_apiterm() throws Exception {
428 AwkTestSupport
429 .cliTest("GAWK apiterm")
430 .argument("-f", gawkFile("apiterm.awk"))
431 .stdin(gawkText("apiterm.in"))
432 .expectLines(gawkPath("apiterm.ok"))
433 .expectExit(0)
434 .runAndAssert();
435 }
436
437 @Test
438 public void test_fnmatch() throws Exception {
439 AwkTestSupport
440 .cliTest("GAWK fnmatch")
441 .argument("-f", gawkFile("fnmatch.awk"))
442 .expectLines(gawkPath("fnmatch.ok"))
443 .expectExit(0)
444 .runAndAssert();
445 }
446
447 @Test
448 public void test_fork() throws Exception {
449 AwkTestSupport
450 .cliTest("GAWK fork")
451 .argument("-f", gawkFile("fork.awk"))
452 .expectLines(gawkPath("fork.ok"))
453 .expectExit(0)
454 .runAndAssert();
455 }
456
457 @Test
458 public void test_fork2() throws Exception {
459 AwkTestSupport
460 .cliTest("GAWK fork2")
461 .argument("-f", gawkFile("fork2.awk"))
462 .expectLines(gawkPath("fork2.ok"))
463 .expectExit(0)
464 .runAndAssert();
465 }
466
467 @Test
468 public void test_functab4() throws Exception {
469 AwkTestSupport
470 .cliTest("GAWK functab4")
471 .argument("-f", gawkFile("functab4.awk"))
472 .expectLines(gawkPath("functab4.ok"))
473 .expectExit(0)
474 .runAndAssert();
475 }
476
477 @Test
478 public void test_functab5() throws Exception {
479 AwkTestSupport
480 .cliTest("GAWK functab5")
481 .argument("-f", gawkFile("functab5.awk"))
482 .expectLines(gawkPath("functab5.ok"))
483 .expectExit(0)
484 .runAndAssert();
485 }
486
487 @Test
488 public void test_ordchr() throws Exception {
489 AwkTestSupport
490 .cliTest("GAWK ordchr")
491 .argument("-f", gawkFile("ordchr.awk"))
492 .expectLines(gawkPath("ordchr.ok"))
493 .expectExit(0)
494 .runAndAssert();
495 }
496
497 @Test
498 public void test_revout() throws Exception {
499 AwkTestSupport
500 .cliTest("GAWK revout")
501 .argument("-f", gawkFile("revout.awk"))
502 .expectLines(gawkPath("revout.ok"))
503 .expectExit(0)
504 .runAndAssert();
505 }
506
507 @Test
508 public void test_revtwoway() throws Exception {
509 AwkTestSupport
510 .cliTest("GAWK revtwoway")
511 .argument("-f", gawkFile("revtwoway.awk"))
512 .expectLines(gawkPath("revtwoway.ok"))
513 .expectExit(0)
514 .runAndAssert();
515 }
516
517 @Test
518 public void test_rwarray() throws Exception {
519 AwkTestSupport
520 .cliTest("GAWK rwarray")
521 .argument("-f", gawkFile("rwarray.awk"))
522 .stdin(gawkText("rwarray.in"))
523 .expectLines(gawkPath("rwarray.ok"))
524 .expectExit(0)
525 .runAndAssert();
526 }
527
528 @Test
529 public void test_time() throws Exception {
530 AwkTestSupport
531 .cliTest("GAWK time")
532 .argument("-f", gawkFile("time.awk"))
533 .expectLines(gawkPath("time.ok"))
534 .expectExit(0)
535 .runAndAssert();
536 }
537
538 @Test
539 public void test_mpfrbigint() throws Exception {
540 skip("gawk's -M bignum mode is not implemented by Jawk.");
541 }
542
543 @Test
544 public void test_mpfrbigint2() throws Exception {
545 skip("gawk's -M bignum mode is not implemented by Jawk.");
546 }
547
548 @Test
549 public void test_mpfrcase() throws Exception {
550 skip("gawk's -M bignum mode is not implemented by Jawk.");
551 }
552
553 @Test
554 public void test_mpfrcase2() throws Exception {
555 skip("gawk's -M bignum mode is not implemented by Jawk.");
556 }
557
558 @Test
559 public void test_mpfrfield() throws Exception {
560 skip("gawk's -M bignum mode is not implemented by Jawk.");
561 }
562
563 @Test
564 public void test_mpfrnegzero() throws Exception {
565 skip("gawk's -M bignum mode is not implemented by Jawk.");
566 }
567
568 @Test
569 public void test_mpfrnegzero2() throws Exception {
570 skip("gawk's -M bignum mode is not implemented by Jawk.");
571 }
572
573 @Test
574 public void test_mpfrnonum() throws Exception {
575 skip("gawk's -M bignum mode is not implemented by Jawk.");
576 }
577
578 @Test
579 public void test_mpfrnr() throws Exception {
580 skip("gawk's -M bignum mode is not implemented by Jawk.");
581 }
582
583 @Test
584 public void test_mpfrrem() throws Exception {
585 skip("gawk's -M bignum mode is not implemented by Jawk.");
586 }
587
588 @Test
589 public void test_mpfrrndeval() throws Exception {
590 skip("gawk's -M bignum mode is not implemented by Jawk.");
591 }
592
593 @Test
594 public void test_mpfrstrtonum() throws Exception {
595 skip("gawk's -M bignum mode is not implemented by Jawk.");
596 }
597
598 @Test
599 public void test_mpgforcenum() throws Exception {
600 skip("gawk's -M bignum mode is not implemented by Jawk.");
601 }
602
603 @Test
604 public void test_pma() throws Exception {
605 Path memoryFile = Files.createTempFile("jawk-pma-", ".bin");
606 Files.deleteIfExists(memoryFile);
607 try {
608 AwkTestSupport
609 .cliTest("GAWK pma first run")
610 .env("JAWK_PERSISTENT_MEMORY", memoryFile.toString())
611 .script("BEGIN { print ++i }")
612 .expect("1\n")
613 .expectExit(0)
614 .runAndAssert();
615 assertTrue(Files.isRegularFile(memoryFile));
616 AwkTestSupport
617 .cliTest("GAWK pma second run")
618 .env("JAWK_PERSISTENT_MEMORY", memoryFile.toString())
619 .script("BEGIN { print ++i }")
620 .expect("2\n")
621 .expectExit(0)
622 .runAndAssert();
623 assertEquals("1\n2\n", gawkText("pma.ok").replace("\r\n", "\n"));
624 } finally {
625 Files.deleteIfExists(memoryFile);
626 }
627 }
628
629 @Test
630 public void test_inetmesg() throws Exception {
631 skip(MANUAL_SKIP_REASON);
632 }
633
634 @Test
635 public void test_profile5() throws Exception {
636 skip(MANUAL_SKIP_REASON);
637 }
638
639 @Test
640 public void test_mpfrieee() throws Exception {
641 skip(MANUAL_SKIP_REASON);
642 }
643
644 @Test
645 public void test_mpfrexprange() throws Exception {
646 skip(MANUAL_SKIP_REASON);
647 }
648
649 @Test
650 public void test_mpfrrnd() throws Exception {
651 skip(MANUAL_SKIP_REASON);
652 }
653
654 @Test
655 public void test_mpfrsort() throws Exception {
656 skip(MANUAL_SKIP_REASON);
657 }
658
659 @Test
660 public void test_mpfruplus() throws Exception {
661 skip(MANUAL_SKIP_REASON);
662 }
663
664 @Test
665 public void test_mpfranswer42() throws Exception {
666 skip(MANUAL_SKIP_REASON);
667 }
668
669 @Test
670 public void test_mpfrmemok1() throws Exception {
671 skip(MANUAL_SKIP_REASON);
672 }
673
674 @Test
675 public void test_mpfrsqrt() throws Exception {
676 skip(MANUAL_SKIP_REASON);
677 }
678
679 @Test
680 public void test_ordchr2() throws Exception {
681 skip(MANUAL_SKIP_REASON);
682 }
683
684 @Test
685 public void test_readfile() throws Exception {
686 skip(MANUAL_SKIP_REASON);
687 }
688
689 @Test
690 public void test_readfile2() throws Exception {
691 AwkTestSupport
692 .cliTest("GAWK readfile2")
693 .argument("-f", gawkFile("readfile2.awk"))
694 .operand(gawkFile("readfile2.awk"), gawkFile("readdir.awk"))
695 .expectLines(gawkPath("readfile2.ok"))
696 .expectExit(0)
697 .runAndAssert();
698 }
699
700 @Test
701 public void test_inplace1() throws Exception {
702 skip(MANUAL_SKIP_REASON);
703 }
704
705 @Test
706 public void test_inplace2() throws Exception {
707 skip(MANUAL_SKIP_REASON);
708 }
709
710 @Test
711 public void test_inplace2bcomp() throws Exception {
712 skip(MANUAL_SKIP_REASON);
713 }
714
715 @Test
716 public void test_inplace3() throws Exception {
717 skip(MANUAL_SKIP_REASON);
718 }
719
720 @Test
721 public void test_inplace3bcomp() throws Exception {
722 skip(MANUAL_SKIP_REASON);
723 }
724
725 @Test
726 public void test_testext() throws Exception {
727 skip(MANUAL_SKIP_REASON);
728 }
729
730 @Test
731 public void test_getfile() throws Exception {
732 skip(MANUAL_SKIP_REASON);
733 }
734
735 @Test
736 public void test_readdir() throws Exception {
737 skip(MANUAL_SKIP_REASON);
738 }
739
740 @Test
741 public void test_readdir_test() throws Exception {
742 skip(MANUAL_SKIP_REASON);
743 }
744
745 @Test
746 public void test_readdir_retest() throws Exception {
747 skip(MANUAL_SKIP_REASON);
748 }
749
750 @Test
751 public void test_readall() throws Exception {
752 skip(MANUAL_SKIP_REASON);
753 }
754
755 @Test
756 public void test_fts() throws Exception {
757 skip(MANUAL_SKIP_REASON);
758 }
759
760 @Test
761 public void test_filefuncs() throws Exception {
762 skip(MANUAL_SKIP_REASON);
763 }
764
765 @Test
766 public void test_indirectbuiltin2() throws Exception {
767 skip(MANUAL_SKIP_REASON);
768 }
769
770 }