Browse Source

Styliser unit tests

Change-Id: Ia66894a79e8b213a0a078a2eadbe11ad8eb7bd5c
Reviewed-on: http://gerrit.dmdirc.com/795
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.3b1
Chris Smith 14 years ago
parent
commit
79bfaf84b5

+ 0
- 1
test/com/dmdirc/ui/messages/FormatterTest.java View File

@@ -22,7 +22,6 @@
22 22
 package com.dmdirc.ui.messages;
23 23
 
24 24
 import com.dmdirc.harness.TestConfigManagerOptionToggle;
25
-import com.dmdirc.config.ConfigManager;
26 25
 import org.junit.Test;
27 26
 import static org.junit.Assert.*;
28 27
 

+ 2
- 0
test/com/dmdirc/ui/messages/StyliserIndicesTest.java View File

@@ -62,6 +62,8 @@ public class StyliserIndicesTest {
62 62
                      0, 4, "Blah"},
63 63
             {"Blah" + Styliser.CODE_COLOUR + "4,0RED blah blah",
64 64
                      4, 7, Styliser.CODE_COLOUR + "4,0RED"},
65
+            {"Blah" + Styliser.CODE_COLOUR + "4,0RED blah blah",
66
+                     5, 7, "ED"},
65 67
         };
66 68
 
67 69
         return Arrays.asList(tests);

+ 5
- 0
test/com/dmdirc/ui/messages/StyliserStylesTest.java View File

@@ -156,12 +156,14 @@ public class StyliserStylesTest {
156 156
             {"Blahblah", "<>B<underline>lah<bold,underline>b<underline>lah"},
157 157
             {"Blahblah", "<>B<underline>lahb<bold>lah"},
158 158
             {"Blahblah", "<>B<underline>lahb<bold>l<>ah"},
159
+            {"Blahblah", "<>B<underline>l<>ahb<bold,underline>l<>ah"},
159 160
             // IRC colours
160 161
             {"4moo", "<color=255,0,0>moo"},
161 162
             {"4moo", "<color=255,0,0>m<>oo"},
162 163
             {"4moo", "<color=255,0,0>m<>oo"},
163 164
             {"20moo", "<color=255,0,0>m<>oo"}, // Colours wrap around
164 165
             {"4,4moo", "<color=255,0,0,background=255,0,0>m<>oo"},
166
+            {"4,4m4,4oo", "<color=255,0,0,background=255,0,0>moo"},
165 167
             // Persistant irc colours
166 168
             {"4m0oo", "<color=255,0,0>m<color=255,255,255>o<color=255,0,0>o"},
167 169
             {"4moo", "<color=255,0,0>moo"},
@@ -189,6 +191,9 @@ public class StyliserStylesTest {
189 191
             // Negation
190 192
             {"\u0012Blah4FF0000moo", "<>Blahmoo"},
191 193
             {"\u0012Blah4FF0000moo\u0012foo", "<>Blahmoo<bold>foo"},
194
+            {"Blah 4\u0012BlahBlah", "<>Blah <color=255,0,0>BlahBlah"}, // Stop
195
+            {"Blah 4\u0012BlahBlah", "<>Blah <color=255,0,0>BlahBlah"}, // Empty colour
196
+            {"Blah 4\u0012BlahBlah", "<>Blah <color=255,0,0>BlahBlah"}, // Empty hex colour
192 197
         };
193 198
 
194 199
         return Arrays.asList(tests);

Loading…
Cancel
Save