Natools

Check-in [e612c1948b]
Login
Overview
Comment:s_expressions-templates-tests-integers: add tests for prefix and suffix width
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e612c1948b527413d99899e118afc61bd769fcf6
User & Date: nat on 2014-09-30 18:50:49
Other Links: manifest | tags
Context
2014-10-01
17:51
s_expressions-templates-generic_integers: new command for input of several images, leveraging affix syntax check-in: 076d8be66e user: nat tags: trunk
2014-09-30
18:50
s_expressions-templates-tests-integers: add tests for prefix and suffix width check-in: e612c1948b user: nat tags: trunk
2014-09-29
21:50
s_expressions-templates-generic_integers: add width information to prefix and suffixes check-in: 3c1dba5e77 user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-templates-tests-integers.adb from [c71a337dba] to [0104e258a9].

286
287
288
289
290
291
292













293
294
295
296
297
298
299
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312







+
+
+
+
+
+
+
+
+
+
+
+
+







      Test_Render (Test, Ordinal, 2, "2nd");
      Test_Render (Test, Ordinal, 3, "3rd");
      Test_Render (Test, Ordinal, 4, "4th");

      Test_Render (Test, "(prefix (a) (b invalid (9 5)))", 0, "0");
      Test_Render (Test, "(prefix (c (invalid 5) (-1 invalid)))", 0, "0");
      Test_Render (Test, "(prefix (d ((invalid) 5) (-1)) ())", 0, "0");

      declare
         Format : Templates.Integers.Format;
      begin
         Format.Set_Minimum_Width (10);
         Format.Set_Suffix (1, To_Atom ("<sup>er</sup>"), 2);
         Format.Set_Prefix (10, To_Atom ("dix : "));

         Test_Render (Test, Format, "", 5, "         5");
         Test_Render (Test, Format, "", 1, "       1<sup>er</sup>");
         Test_Render (Test, Format, "(centered)", 10, " dix : 10 ");
         Test_Render (Test, Format, "(suffix ((th 0) 7))", 7, "         7th");
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Prefix_And_Suffix;


   procedure Static_Hash_Map (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Parse errors in template");