summaryrefslogtreecommitdiff
path: root/test/rat_tests-parsers.ads
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2020-12-10 23:22:19 +1100
committerJed Barber <jjbarber@y7mail.com>2020-12-10 23:22:19 +1100
commit192172cfc44220975b34295d38c5213b08de5191 (patch)
tree555de972762414ba11e3e3f9908425dba55675f7 /test/rat_tests-parsers.ads
parentfb29719b1ce83fca511c1f310b388e0af65da257 (diff)
Some unit tests for Packrat.Parsers
Diffstat (limited to 'test/rat_tests-parsers.ads')
-rw-r--r--test/rat_tests-parsers.ads85
1 files changed, 85 insertions, 0 deletions
diff --git a/test/rat_tests-parsers.ads b/test/rat_tests-parsers.ads
new file mode 100644
index 0000000..a70f41e
--- /dev/null
+++ b/test/rat_tests-parsers.ads
@@ -0,0 +1,85 @@
+
+
+with
+
+ Unit_Tests;
+
+use
+
+ Unit_Tests;
+
+private with
+
+ Packrat.No_Lex,
+ Packrat.Parsers.Debug,
+ Packrat.Errors,
+ Packrat.Traits;
+
+
+package Rat_Tests.Parsers is
+
+
+ function Count_Check return Test_Result;
+ function Many_Nomin_Check return Test_Result;
+ function Many_Min_Check return Test_Result;
+
+ function Many_Until_Nomin_Check return Test_Result;
+ function Many_Until_Min_Check return Test_Result;
+
+ function Satisfy_Check return Test_Result;
+ function Satisfy_With_Check return Test_Result;
+ function Match_Check return Test_Result;
+ function Match_With_Check return Test_Result;
+ function Multimatch_Check return Test_Result;
+ function Take_Check return Test_Result;
+ function Take_While_Check return Test_Result;
+ function Take_Until_Check return Test_Result;
+
+ function Empty_Check return Test_Result;
+ function Not_Empty_Check return Test_Result;
+
+ Combinator_Tests : Test_Array :=
+ ((+"Count", Count_Check'Access),
+ (+"Many No Minimum", Many_Nomin_Check'Access),
+ (+"Many With Minimum", Many_Min_Check'Access),
+ (+"Many_Until No Minimum", Many_Until_Nomin_Check'Access),
+ (+"Many_Until With Minimum", Many_Until_Min_Check'Access),
+ (+"Satisfy", Satisfy_Check'Access),
+ (+"Satisfy_With", Satisfy_With_Check'Access),
+ (+"Match", Match_Check'Access),
+ (+"Match_With", Match_With_Check'Access),
+ (+"Multimatch", Multimatch_Check'Access),
+ (+"Take", Take_Check'Access),
+ (+"Take_While", Take_While_Check'Access),
+ (+"Take_Until", Take_Until_Check'Access),
+ (+"Empty", Empty_Check'Access),
+ (+"Not_Empty", Not_Empty_Check'Access));
+
+
+ function Default_Result_Check return Test_Result;
+
+ Other_Tests : Test_Array :=
+ (1 => (+"Default Combinator Result", Default_Result_Check'Access));
+
+
+private
+
+
+ type Parser_Labels_One is (One, Two, Three, Four, Five, Six);
+
+ package Pone is new Packrat.No_Lex
+ (Parser_Labels_One, Character, String);
+
+ package One_Debug is new Pone.Parsers.Debug;
+
+
+
+
+ function Alphanum_Switch
+ (Char : in Character)
+ return Character;
+
+
+end Rat_Tests.Parsers;
+
+