emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 158fd83 16/28: Test the trimming function.


From: Jackson Ray Hamilton
Subject: [elpa] master 158fd83 16/28: Test the trimming function.
Date: Tue, 05 May 2015 11:10:21 +0000

branch: master
commit 158fd8328570250fcaafcdf77c1f08a72fe99b62
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Test the trimming function.
---
 test/context-coloring-test.el |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index e52886e..8600e06 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -320,9 +320,21 @@ FOREGROUND.  Apply ARGUMENTS to
     (when (not error-signaled-p)
       (ert-fail "Expected an error to be thrown, but there wasn't."))))
 
+(defun context-coloring-test-assert-trimmed (result expected)
+  (when (not (string-equal result expected))
+    (ert-fail "Expected string to be trimmed, but it wasn't.")))
+
 
 ;;; The tests
 
+(ert-deftest context-coloring-test-trim ()
+  (context-coloring-test-assert-trimmed (context-coloring-trim "") "")
+  (context-coloring-test-assert-trimmed (context-coloring-trim " ") "")
+  (context-coloring-test-assert-trimmed (context-coloring-trim "a") "a")
+  (context-coloring-test-assert-trimmed (context-coloring-trim " a") "a")
+  (context-coloring-test-assert-trimmed (context-coloring-trim "a ") "a")
+  (context-coloring-test-assert-trimmed (context-coloring-trim " a ") "a"))
+
 (ert-deftest-async context-coloring-test-async-mode-startup (done)
   (context-coloring-test-with-fixture-async
    "./fixtures/empty"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]