|
@@ -190,6 +190,27 @@ public class ConfigFileTest extends junit.framework.TestCase {
|
190
|
190
|
assertEquals("hello", data.get("test3\\"));
|
191
|
191
|
}
|
192
|
192
|
|
|
193
|
+ @Test
|
|
194
|
+ public void testHash() throws IOException, InvalidConfigFileException {
|
|
195
|
+ final File file = File.createTempFile("DMDirc.unittest", null);
|
|
196
|
+ ConfigFile config = new ConfigFile(file.toURI());
|
|
197
|
+ Map<String, String> data = new HashMap<String, String>();
|
|
198
|
+ data.put("test1#", "hello");
|
|
199
|
+ data.put("#test2", "hello");
|
|
200
|
+ data.put("test3", "#hello");
|
|
201
|
+ config.addDomain("test", data);
|
|
202
|
+ config.write();
|
|
203
|
+
|
|
204
|
+ config = new ConfigFile(file.toURI());
|
|
205
|
+ config.read();
|
|
206
|
+
|
|
207
|
+ assertTrue(config.isKeyDomain("test"));
|
|
208
|
+ data = config.getKeyDomain("test");
|
|
209
|
+ assertEquals("hello", data.get("test1#"));
|
|
210
|
+ assertEquals("hello", data.get("#test2"));
|
|
211
|
+ assertEquals("#hello", data.get("test3"));
|
|
212
|
+ }
|
|
213
|
+
|
193
|
214
|
@Test
|
194
|
215
|
public void testEscape() {
|
195
|
216
|
final String input = "blah blah\\foo\r\nbar=:";
|