[pango] test-break: Add a legend



commit b4edec796225a2348812964ae9c186dba6780ae2
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 9 21:47:19 2020 -0400

    test-break: Add a legend
    
    Use test-break --help to get a legend for the
    codes used in the output.

 tests/test-break.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/tests/test-break.c b/tests/test-break.c
index fca5677bf..e020b583c 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -316,11 +316,26 @@ main (int argc, char *argv[])
   /* allow to easily generate expected output for new test cases */
   if (argc > 1)
     {
-      GString *string;
+      if (strcmp (argv[1], "--help") == 0)
+        {
+          g_print ("test-break uses the following symbols for log attrs\n\n");
+          g_print ("Breaks:                 Words:\n"
+                   " L - mandatory break     b - word boundary\n"
+                   " l - line break          s - word start\n"
+                   " c - char break          e - word end\n"
+                   "\n"
+                   "Whitespace:             Sentences:\n"
+                   " x - expandable space    s - sentence start\n"
+                   " w - whitespace          e - sentence end\n");
+        }
+      else
+        {
+          GString *string;
 
-      string = g_string_sized_new (0);
-      test_file (argv[1], string);
-      g_print ("%s", string->str);
+          string = g_string_sized_new (0);
+          test_file (argv[1], string);
+          g_print ("%s", string->str);
+        }
 
       return 0;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]