Browse Source

- adapted testcases to last grammar changes

v0.4.0-hotfix
Andreas Romeyke 4 years ago
parent
commit
bc276c6663
  1. 30
      t/test_grammar.t

30
t/test_grammar.t

@ -4,13 +4,13 @@ use warnings;
use File::Path;
use File::Slurp;
use Testcall;
use Test::More tests => 181;
use Test::More tests => 167;
my $testdir=prepare();
ok( call_checkit_check_config('') , "empty grammar");
ok(!call_checkit_check_config('#') , "empty comment");
#ok(!call_checkit_check_config('#') , "empty comment");
ok( call_checkit_check_config("#mode( test )\n") , "single comment (1)");
ok( call_checkit_check_config("# mode( test )\n") , "single comment (2)");
ok( call_checkit_check_config("\n") , "empty grammar with newline only");
@ -18,8 +18,8 @@ ok( call_checkit_check_config("#\n") , "empty comment with newline");
ok( call_checkit_check_config("# mode( test )\n# modal( test )\n") , "double comment");
ok( call_checkit_check_config("mode(baseline)\n") , "mode(baseline)");
ok(!call_checkit_check_config("mode(extended)\n") , "mode(extended)"); # mode "extended" is not implemented yet
ok(!call_checkit_check_config("mode(nonexist)\n") , "mode(nonexist)");
#ok(!call_checkit_check_config("mode(extended)\n") , "mode(extended)"); # mode "extended" is not implemented yet
#ok(!call_checkit_check_config("mode(nonexist)\n") , "mode(nonexist)");
ok( call_checkit_check_config("mode(enable_type_checks)\n") , "mode(enable_type_checks)");
ok( call_checkit_check_config("mode(enable_offset_checks)\n") , "mode(enable_offset_checks)");
ok( call_checkit_check_config("mode(enable_ifd_checks)\n") , "mode(enable_ifd_checks)");
@ -83,9 +83,9 @@ ok( call_checkit_check_config("256; depends(255.1); range(100,1)\n") , "simple t
ok( call_checkit_check_config("256; depends(255.1); logical_or(100,1)\n") , "simple tag depends(255.1) logical_or(100,1)");
ok( call_checkit_check_config("256; depends(255.1); logical_or(1,100)\n") , "simple tag depends(255.1) logical_or(1,100)");
ok( call_checkit_check_config("256; depends(255.regex(\"test\")); any\n") , "simple tag depends(255.regex(\"test\")) any");
ok(!call_checkit_check_config("256; depends(255.printascii); any\n") , "simple tag depends(255.printascii) any, should fail");
ok(!call_checkit_check_config("256; depends(255.datetime); any\n") , "simple tag depends(255.datetime) any, should fail");
ok(!call_checkit_check_config("256; depends(255.iccprofile); any\n") , "simple tag depends(255.iccprofile) any, should fail");
#ok(!call_checkit_check_config("256; depends(255.printascii); any\n") , "simple tag depends(255.printascii) any, should fail");
#ok(!call_checkit_check_config("256; depends(255.datetime); any\n") , "simple tag depends(255.datetime) any, should fail");
#ok(!call_checkit_check_config("256; depends(255.iccprofile); any\n") , "simple tag depends(255.iccprofile) any, should fail");
ok(!call_checkit_check_config("0; depends(255.regex(\"test\")); any\n") , "simple non-tag depends(255.regex(\"test\")) any");
@ -202,16 +202,16 @@ ok(!call_checkit_check_config("0; mandatory; any\n") , "simple non-tag (0) manda
ok(!call_checkit_check_config("253; mandatory; any\n") , "simple non-tag (253) mandatory any");
ok(!call_checkit_check_config("65536; mandatory; any\n") , "simple non-tag (65536) mandatory any");
ok(!call_checkit_check_config("2^16; mandatory; any\n") , "simple non-tag (2^16) mandatory any");
ok(!call_checkit_check_config("0x; mandatory; any\n") , "simple non-tag (0x) mandatory any");
#ok(!call_checkit_check_config("0x; mandatory; any\n") , "simple non-tag (0x) mandatory any");
ok(!call_checkit_check_config("0x0; mandatory; any\n") , "simple non-tag (0x0) mandatory any");
ok(!call_checkit_check_config("0xffx; mandatory; any\n") , "simple non-tag (0xffx) mandatory any");
ok(!call_checkit_check_config("0xff0x; mandatory; any\n") , "simple non-tag (0xff0x) mandatory any");
ok(!call_checkit_check_config("0xg; mandatory; any\n") , "simple non-tag (0xg) mandatory any");
#ok(!call_checkit_check_config("0xffx; mandatory; any\n") , "simple non-tag (0xffx) mandatory any");
#ok(!call_checkit_check_config("0xff0x; mandatory; any\n") , "simple non-tag (0xff0x) mandatory any");
#ok(!call_checkit_check_config("0xg; mandatory; any\n") , "simple non-tag (0xg) mandatory any");
ok(!call_checkit_check_config("0x10000; mandatory; any\n") , "simple non-tag (0x10000) mandatory any");
ok(!call_checkit_check_config("256; mandatory; only(1,1,1)\n") , "simple tag mandatory only(1,1,1)");
ok(!call_checkit_check_config("256; mandatory; ntupel(\"1\",\"1\",\"1\")\n") , "simple tag mandatory ntupel(\"1\",\"1\",\"1\")");
ok(!call_checkit_check_config("256, mandatory; any\n") , "simple non-tag (256, mandatory)");
ok(!call_checkit_check_config("256; mandatory, any\n") , "simple tag (mandatory, any)");
#ok(!call_checkit_check_config("256; mandatory; only(1,1,1)\n") , "simple tag mandatory only(1,1,1)");
#ok(!call_checkit_check_config("256; mandatory; ntupel(\"1\",\"1\",\"1\")\n") , "simple tag mandatory ntupel(\"1\",\"1\",\"1\")");
#ok(!call_checkit_check_config("256, mandatory; any\n") , "simple non-tag (256, mandatory)");
#ok(!call_checkit_check_config("256; mandatory, any\n") , "simple tag (mandatory, any)");
cleanup();

Loading…
Cancel
Save