diff options
author | Adrian Thurston <thurston@colm.net> | 2021-12-28 20:19:46 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2021-12-28 20:19:46 +0000 |
commit | d4577c924451b331c73c8ed0af04f6efd35ac0b4 (patch) | |
tree | 0af0283a3f1f641a556ba82c0ac8eb79e7f51628 | |
parent | 841bd4cf20c9d512fa7a3c80326f0013ac2e3ced (diff) | |
download | ragel-d4577c924451b331c73c8ed0af04f6efd35ac0b4.tar.gz |
some test cases with from-state actions now need eof and output updating
With the fix in for #80, test cases that embed from-state actions, but no eof
actions, now need to have eof set. Updating output to reflect the calls on eof
is also required in some cases.
-rw-r--r-- | test/ragel.d/condrep1.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/condrep2.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/condrep3.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/condrep4.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/fnext1.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/fnext2.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/fnext3.rl | 1 | ||||
-rw-r--r-- | test/ragel.d/stateact1.rl | 2 | ||||
-rw-r--r-- | test/ragel.d/tofrom2.rl | 17 |
9 files changed, 25 insertions, 1 deletions
diff --git a/test/ragel.d/condrep1.rl b/test/ragel.d/condrep1.rl index 10ae8949..374ca89b 100644 --- a/test/ragel.d/condrep1.rl +++ b/test/ragel.d/condrep1.rl @@ -30,6 +30,7 @@ void test( int min, int max, const char *str ) int cs; const char *p = str; const char *pe = str + strlen( str ) + 1; + const char *eof = pe; int c = 0, seen = 0; cout << "run " << str << " " << min << " " << max << ":"; diff --git a/test/ragel.d/condrep2.rl b/test/ragel.d/condrep2.rl index e1b350dd..d598796a 100644 --- a/test/ragel.d/condrep2.rl +++ b/test/ragel.d/condrep2.rl @@ -30,6 +30,7 @@ void test( int min, int max, const char *str ) int cs; const char *p = str; const char *pe = str + strlen( str ) + 1; + const char *eof = pe; int c = 0, seen = 0; cout << "run " << str << " " << min << " " << max << ":"; diff --git a/test/ragel.d/condrep3.rl b/test/ragel.d/condrep3.rl index df5f3f25..55d2f980 100644 --- a/test/ragel.d/condrep3.rl +++ b/test/ragel.d/condrep3.rl @@ -28,6 +28,7 @@ void test( int min, int max, const char *str ) int cs; const char *p = str; const char *pe = str + strlen( str ) + 1; + const char *eof = pe; int c = 0, seen = 0; cout << "run " << str << " " << min << " " << max << ":"; diff --git a/test/ragel.d/condrep4.rl b/test/ragel.d/condrep4.rl index 3a8bb85c..f1685a73 100644 --- a/test/ragel.d/condrep4.rl +++ b/test/ragel.d/condrep4.rl @@ -28,6 +28,7 @@ void test( int min, int max, const char *str ) int cs; const char *p = str; const char *pe = str + strlen( str ) + 1; + const char *eof = pe; int c = 0, seen = 0; cout << "run " << str << " " << min << " " << max << ":"; diff --git a/test/ragel.d/fnext1.rl b/test/ragel.d/fnext1.rl index 631a29c7..866ed51d 100644 --- a/test/ragel.d/fnext1.rl +++ b/test/ragel.d/fnext1.rl @@ -38,6 +38,7 @@ void exec( char *data, int len ) { char *p = data; char *pe = data + len; + char *eof = pe; while ( cs != fnext_error && p < pe ) { printf( "%c\n", *p ); diff --git a/test/ragel.d/fnext2.rl b/test/ragel.d/fnext2.rl index 69bfee47..c37a0ee4 100644 --- a/test/ragel.d/fnext2.rl +++ b/test/ragel.d/fnext2.rl @@ -37,6 +37,7 @@ void exec( char *data, int len ) { char *p = data; char *pe = data + len; + char *eof = pe; while ( cs != fnext_error && p < pe ) { printf( "%c\n", *p ); diff --git a/test/ragel.d/fnext3.rl b/test/ragel.d/fnext3.rl index 69bfee47..c37a0ee4 100644 --- a/test/ragel.d/fnext3.rl +++ b/test/ragel.d/fnext3.rl @@ -37,6 +37,7 @@ void exec( char *data, int len ) { char *p = data; char *pe = data + len; + char *eof = pe; while ( cs != fnext_error && p < pe ) { printf( "%c\n", *p ); diff --git a/test/ragel.d/stateact1.rl b/test/ragel.d/stateact1.rl index e5878b7c..f8cb6dbc 100644 --- a/test/ragel.d/stateact1.rl +++ b/test/ragel.d/stateact1.rl @@ -1,5 +1,6 @@ /* * @LANG: indep + * @NEEDS_EOF: yes * * Test in and out state actions. */ @@ -44,4 +45,5 @@ b2 c1 c2 b1 +b2 FAIL diff --git a/test/ragel.d/tofrom2.rl b/test/ragel.d/tofrom2.rl index 3c201e73..4544b6d4 100644 --- a/test/ragel.d/tofrom2.rl +++ b/test/ragel.d/tofrom2.rl @@ -62,7 +62,8 @@ void init() void exec( char *data, int len ) { char *p = data; - char *pe = data + len; + const char *pe = data + len; + const char *eof = pe; %% write exec; } @@ -70,6 +71,8 @@ void finish( ) { if ( cs < atoi_first_final ) printf( "-> FAIL\n" ); + else + printf( "-> ACCEPT\n" ); } char *inp[] = { @@ -103,6 +106,8 @@ to on 49 from on 10 1 to on 10 +from on 0 +-> ACCEPT from on 49 to on 49 from on 50 @@ -110,6 +115,8 @@ to on 50 from on 10 12 to on 10 +from on 0 +-> ACCEPT from on 50 to on 50 from on 50 @@ -125,6 +132,8 @@ to on 50 from on 10 222222 to on 10 +from on 0 +-> ACCEPT from on 43 to on 43 from on 50 @@ -138,6 +147,8 @@ to on 51 from on 10 2123 to on 10 +from on 0 +-> ACCEPT from on 45 to on 45 from on 57 @@ -147,6 +158,8 @@ to on 57 from on 10 -99 to on 10 +from on 0 +-> ACCEPT from on 45 to on 45 from on 49 @@ -162,6 +175,8 @@ to on 49 from on 10 -12321 to on 10 +from on 0 +-> ACCEPT from on 50 to on 50 from on 49 |