1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
------------------------------------------------------------------------------
-- Copyright (c) 2013, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
package body Natools.S_Expressions.Test_Tools is
Hex_Digits : constant String := "0123456789ABCDEF";
function Encode_Hex (Value : Offset; Length : Positive) return String;
function Hex_Slice
|
|
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
------------------------------------------------------------------------------
-- Copyright (c) 2013-2015, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Parsers;
package body Natools.S_Expressions.Test_Tools is
Hex_Digits : constant String := "0123456789ABCDEF";
function Encode_Hex (Value : Offset; Length : Positive) return String;
function Hex_Slice
|
479
480
481
482
483
484
485
486
487
488
489
490
491
492
|
& ", expected Add_Atom");
else
Test_Tools.Test_Atom_Accessors
(Test, Tested, Expected, Level, Context);
end if;
end Next_And_Check;
-------------------
-- Memory Stream --
-------------------
overriding procedure Read
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
& ", expected Add_Atom");
else
Test_Tools.Test_Atom_Accessors
(Test, Tested, Expected, Level, Context);
end if;
end Next_And_Check;
function To_S_Expression (Text : String) return Caches.Reference is
begin
return To_S_Expression (To_Atom (Text));
end To_S_Expression;
function To_S_Expression (Data : Atom) return Caches.Reference is
Stream : aliased Memory_Stream;
Parser : Parsers.Stream_Parser (Stream'Access);
begin
Stream.Write (Data);
Parser.Next;
return Caches.Move (Parser);
end To_S_Expression;
-------------------
-- Memory Stream --
-------------------
overriding procedure Read
|