From 8e5afbe87e05ce78521a3dbcd0ba8dc71bbaffec Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 5 Dec 2020 20:06:52 +1100 Subject: Workaround for linker issues in unit tests --- test/rat_tests-lexers.adb | 43 --------------------------------------- test/rat_tests-lexers.ads | 51 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 45 deletions(-) (limited to 'test') diff --git a/test/rat_tests-lexers.adb b/test/rat_tests-lexers.adb index e216461..7c2fb97 100644 --- a/test/rat_tests-lexers.adb +++ b/test/rat_tests-lexers.adb @@ -1,33 +1,8 @@ -with - - Packrat.Errors, - Packrat.Traits, - Packrat.Lexers.Debug, - Packrat.Utilities; - - package body Rat_Tests.Lexers is - package PU renames Packrat.Utilities; - - - type My_Labels is (One, Two, Three); - - - package Slexy_Traits is new Packrat.Traits (My_Labels, Character, String); - package Slexy is new Packrat.Lexers (Slexy_Traits); - package Slebug is new Slexy.Debug; - - - use type Slexy.Combinator_Result; - - - - - function Join_Check return Test_Result is @@ -648,24 +623,6 @@ package body Rat_Tests.Lexers is - type Word_Enum is (Blank, Word, Whitespace); - - package Swordy_Traits is new Packrat.Traits (Word_Enum, Character, String); - package Swordy is new Packrat.Lexers (Swordy_Traits); - package Swolbug is new Swordy.Debug; - - use type Swordy_Traits.Tokens.Token_Type; - use type Swordy_Traits.Tokens.Token_Array; - - function Satisfy_Letter is new Swordy.Satisfy (PU.Is_Letter); - function Many_Letter is new Swordy.Many (Satisfy_Letter, 1); - function Satisfy_Whitespace is new Swordy.Satisfy (PU.Is_Whitespace); - function Many_Whitespace is new Swordy.Many (Satisfy_Whitespace, 1); - - function Stamp_Word is new Swordy.Stamp (Word, Many_Letter); - function Ignore_Whitespace is new Swordy.Ignore (Whitespace, Many_Whitespace); - - function Scan_Parts_Check return Test_Result is diff --git a/test/rat_tests-lexers.ads b/test/rat_tests-lexers.ads index fe6cca8..6c8a4d7 100644 --- a/test/rat_tests-lexers.ads +++ b/test/rat_tests-lexers.ads @@ -1,7 +1,19 @@ -with Unit_Tests; -use Unit_Tests; +with + + Unit_Tests; + +use + + Unit_Tests; + +private with + + Packrat.Errors, + Packrat.Traits, + Packrat.Lexers.Debug, + Packrat.Utilities; package Rat_Tests.Lexers is @@ -76,6 +88,41 @@ package Rat_Tests.Lexers is (+"Scan_Set_With Exception", Scan_Set_With_Error_Check'Access)); +private + + + package PU renames Packrat.Utilities; + + + type My_Labels is (One, Two, Three); + + + package Slexy_Traits is new Packrat.Traits (My_Labels, Character, String); + package Slexy is new Packrat.Lexers (Slexy_Traits); + package Slebug is new Slexy.Debug; + + + use type Slexy.Combinator_Result; + + + type Word_Enum is (Blank, Word, Whitespace); + + package Swordy_Traits is new Packrat.Traits (Word_Enum, Character, String); + package Swordy is new Packrat.Lexers (Swordy_Traits); + package Swolbug is new Swordy.Debug; + + use type Swordy_Traits.Tokens.Token_Type; + use type Swordy_Traits.Tokens.Token_Array; + + function Satisfy_Letter is new Swordy.Satisfy (PU.Is_Letter); + function Many_Letter is new Swordy.Many (Satisfy_Letter, 1); + function Satisfy_Whitespace is new Swordy.Satisfy (PU.Is_Whitespace); + function Many_Whitespace is new Swordy.Many (Satisfy_Whitespace, 1); + + function Stamp_Word is new Swordy.Stamp (Word, Many_Letter); + function Ignore_Whitespace is new Swordy.Ignore (Whitespace, Many_Whitespace); + + end Rat_Tests.Lexers; -- cgit