[pango/break-test] Make the break test actually test things



commit 81606a099a86adc2c99e1c88d34109b9cca4c7ef
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 7 17:58:34 2019 -0400

    Make the break test actually test things
    
    We were not diffing the output against the
    expected results.

 tests/breaks/one.expected | 10 +++++-----
 tests/meson.build         |  2 +-
 tests/test-break.c        | 12 +++++++++++-
 3 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/tests/breaks/one.expected b/tests/breaks/one.expected
index 90ea8d18..7fddaf91 100644
--- a/tests/breaks/one.expected
+++ b/tests/breaks/one.expected
@@ -1,5 +1,5 @@
-Text:        a b c /  d e f [ ]  g h i [0xad]   j k l . [ ]  B l a [0x0a]  
-Breaks:     c c c c lc c c c   lc c c c      lhc c c c c   lc c c c      Lc
-Whitespace:                x                           x          w      w 
-Words:      s     e s      e   s                     e     s      e        
-Sentences:  s                                          e   s      e        
+Text:          a b c  /  d e f  [ ]  g h i [0xad]   j k l  . [ ]   B l a  [0x0a]  
+Breaks:     c   c c c  lc c c c    lc c c c      lhc c c c  c   lc  c c c       Lc
+Whitespace:                   x                             x           w       w 
+Words:      bs     be bs     be   bs                    be b   bs     be      b
+Sentences:  bs                                               e   bs       e       b  
diff --git a/tests/meson.build b/tests/meson.build
index 50176c3d..6357cd8a 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -22,7 +22,7 @@ tests = [
   [ 'testcolor' ],
   [ 'testscript' ],
   [ 'cxx-test', [ 'cxx-test.cpp' ] ],
-  [ 'test-break' ],
+  [ 'test-break', [ 'test-break.c', 'test-common.c' ] ],
 ]
 
 if build_pangoft2
diff --git a/tests/test-break.c b/tests/test-break.c
index 9f069c09..acbe9014 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -117,6 +117,11 @@ test_file (const gchar *filename, GString *string)
           w++;
         }
 
+      if (log.is_word_boundary)
+        {
+          g_string_append (s3, "b");
+          o++;
+        }
       if (log.is_word_start)
         {
           g_string_append (s3, "s");
@@ -128,6 +133,11 @@ test_file (const gchar *filename, GString *string)
           o++;
         }
 
+      if (log.is_sentence_boundary)
+        {
+          g_string_append (s4, "b");
+          s++;
+        }
       if (log.is_sentence_start)
         {
           g_string_append (s4, "s");
@@ -228,7 +238,7 @@ test_break (gconstpointer d)
 
   test_file (filename, dump);
 
-  //diff = diff_with_file (expected_file, dump->str, dump->len, &error);
+  diff = diff_with_file (expected_file, dump->str, dump->len, &error);
   g_assert_no_error (error);
 
   if (diff && diff[0])


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