diff options
Diffstat (limited to 'test/ratnest-tests.adb')
-rw-r--r-- | test/ratnest-tests.adb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/ratnest-tests.adb b/test/ratnest-tests.adb index df17775..1f0950d 100644 --- a/test/ratnest-tests.adb +++ b/test/ratnest-tests.adb @@ -162,6 +162,48 @@ package body Ratnest.Tests is + function Token_Adjust_Check + return Test_Result + is + type My_Labels is (One, Two, Three); + package My_Tokens is new Packrat.Tokens (My_Labels, Character, String); + + A : My_Tokens.Token; + begin + declare + B : My_Tokens.Token := My_Tokens.Create (One, 1, 3, "abc"); + begin + A := B; + end; + if not A.Initialized or else A.Value /= "abc" then + return Failure; + end if; + return Success; + end Token_Adjust_Check; + + + function Token_Store_Check + return Test_Result + is + type My_Labels is (One, Two, Three); + package My_Tokens is new Packrat.Tokens (My_Labels, Character, String); + + T : My_Tokens.Token := My_Tokens.Create (One, 1, 3, "abc"); + begin + if not T.Initialized or else + T.Label /= One or else + T.Start /= 1 or else T.Finish /= 3 or else + T.Value /= "abc" + then + return Failure; + end if; + return Success; + end Token_Store_Check; + + + + + function In_Set_Check return Test_Result is |