Index: tests/natools-s_expressions-parsers-tests.adb ================================================================== --- tests/natools-s_expressions-parsers-tests.adb +++ tests/natools-s_expressions-parsers-tests.adb @@ -115,10 +115,12 @@ procedure All_Tests (Report : in out NT.Reporter'Class) is begin Canonical_Encoding (Report); Atom_Encodings (Report); Base64_Subexpression (Report); + Special_Subexpression (Report); + Nested_Subpexression (Report); Number_Prefixes (Report); Quoted_Escapes (Report); end All_Tests; @@ -165,10 +167,24 @@ Expected => To_Atom ("4:head((7:sublist)5:token)4:tail")); begin Test (Report); end Base64_Subexpression; + + procedure Nested_Subpexression (Report : in out NT.Reporter'Class) is + procedure Test is new Blackbox_Test + (Name => "Nested base-64 subepxressions", + Source => To_Atom ("(5:begin" + & "{KG5lc3RlZCB7S0dSbFpYQWdjR0Y1Ykc5aFpDaz19KQ==}" + & "end)"), + Expected => To_Atom ("(5:begin" + & "(6:nested(4:deep7:payload))" + & "3:end)")); + begin + Test (Report); + end Nested_Subpexression; + procedure Number_Prefixes (Report : in out NT.Reporter'Class) is procedure Test is new Blackbox_Test (Name => "Number prefixes", Source => To_Atom ("8:verbatim" @@ -209,6 +225,22 @@ & "(7:special2:\x1:"")")); begin Test (Report); end Quoted_Escapes; + + procedure Special_Subexpression (Report : in out NT.Reporter'Class) is + procedure Test is new Blackbox_Test + (Name => "Special base-64 subexpression", + Source => To_Atom ("(begin " + & "{aGlkZGVuLWVuZCkoaGlkZGVuLWJlZ2lu}" + & " end)" + & "({MTY6b3ZlcmZsb3dpbmc=} atom)"), + Expected => To_Atom ("(5:begin" + & "10:hidden-end)(12:hidden-begin" + & "3:end)" + & "(16:overflowing atom)")); + begin + Test (Report); + end Special_Subexpression; + end Natools.S_Expressions.Parsers.Tests; Index: tests/natools-s_expressions-parsers-tests.ads ================================================================== --- tests/natools-s_expressions-parsers-tests.ads +++ tests/natools-s_expressions-parsers-tests.ads @@ -29,9 +29,11 @@ procedure All_Tests (Report : in out NT.Reporter'Class); procedure Atom_Encodings (Report : in out NT.Reporter'Class); procedure Base64_Subexpression (Report : in out NT.Reporter'Class); procedure Canonical_Encoding (Report : in out NT.Reporter'Class); + procedure Nested_Subpexression (Report : in out NT.Reporter'Class); procedure Number_Prefixes (Report : in out NT.Reporter'Class); procedure Quoted_Escapes (Report : in out NT.Reporter'Class); + procedure Special_Subexpression (Report : in out NT.Reporter'Class); end Natools.S_Expressions.Parsers.Tests;