Natools

Check-in [e21eaeef3f]
Login
Overview
Comment:s_expressions-conditionals-strings-tests: test the new equality test
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e21eaeef3f49a8db0a21ddb888df25cca79ab84a
User & Date: nat on 2017-06-18 21:35:35
Other Links: manifest | tags
Context
2017-06-19
21:20
s_expressions-parsers-tests: add a test for Close_Current_List primitive check-in: 38b822e5a1 user: nat tags: trunk
2017-06-18
21:35
s_expressions-conditionals-strings-tests: test the new equality test check-in: e21eaeef3f user: nat tags: trunk
2017-06-17
19:33
s_expressions-conditionals-strings: add an equality test check-in: 87228b7a84 user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-conditionals-strings-tests.adb from [3102aeb9ac] to [c4653ee8dd].

1
2

3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9

-
+







------------------------------------------------------------------------------
-- Copyright (c) 2015, Natacha Porté                                        --
-- Copyright (c) 2015-2017, 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         --
112
113
114
115
116
117
118

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138




139
140
141
142
143
144
145
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150







+




















+
+
+
+







   begin
      declare
         procedure Check (Value : in String; Expected : in Boolean := True);

         Image : constant String := "Expression 1";
         Exp : constant Caches.Reference := Test_Tools.To_S_Expression
           ("(or is-empty (starts-with Hi)"
            & "(is BY) (case-insensitive (is HELLO))"
            & "(and (contains 1:.) (contains-any-of 1:! 1:?))"
            & "(case-insensitive (or (contains aLiCe)"
            & " (case-sensitive (contains Bob))))"
            & "(not is-ascii))");

         procedure Check (Value : in String; Expected : in Boolean := True) is
         begin
            Check (Test, Value, Exp, Image, Expected);
         end Check;
      begin
         Check ("");
         Check ("A", False);
         Check ("Hi, my name is John.");
         Check ("Hello, my name is John.", False);
         Check ("Hello. My name is John!");
         Check ("Hello. My name is John?");
         Check ("Alice and Bob");
         Check ("BOBBY!", False);
         Check ("AlicE and Malory");
         Check ("©");
         Check ("BY");
         Check ("By", False);
         Check ("Hello");
         Check ("Hell", False);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Basic_Usage;


   procedure Fallbacks (Report : in out NT.Reporter'Class) is