522
523
524
525
526
527
528
529
530
531
532
533
534
|
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
Report_Result (Name, Reported);
NT.Info (Report, "Found """ & To_String (CS_Right) & '"');
NT.Info (Report, "Expected """ & Right & '"');
end if;
end;
Report_Result (Name, Reported, NT.Success);
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
declare
Name : constant String := "Multi-chunk Trim prefix";
Str : constant String
:= Ada.Strings.Fixed."*" (Default_Chunk_Size * 2, ' ') & " word";
CS : Chunked_String := To_Chunked_String (Str);
Space_Set : constant Ada.Strings.Maps.Character_Set
:= Ada.Strings.Maps.To_Set (" ");
begin
CS.Trim (Space_Set, Space_Set);
if CS.To_String = "word" then
NT.Item (Report, Name, NT.Success);
else
NT.Item (Report, Name, NT.Fail);
NT.Info (Report, "Found """ & CS.To_String & '"');
NT.Info (Report, "Expected ""word""");
end if;
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
Natools.Tests.End_Section (Report);
end Natools.Chunked_Strings.Tests.Coverage;
|