Changeset 10299 in josm for trunk/test/unit/org
- Timestamp:
- 2016-05-29T16:33:08+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/ExtensionFileFilterTest.java
r9669 r10299 2 2 package org.openstreetmap.josm.actions; 3 3 4 import nl.jqno.equalsverifier.EqualsVerifier;4 import static org.junit.Assert.assertEquals; 5 5 6 6 import org.junit.Test; 7 8 import nl.jqno.equalsverifier.EqualsVerifier; 7 9 8 10 /** … … 10 12 */ 11 13 public class ExtensionFileFilterTest { 14 15 private static void test(String extensions, String defaultExtension, String description, boolean addArchiveExtensionsToDescription, 16 String expectedExtensions, String expectedDescription) { 17 ExtensionFileFilter ext = ExtensionFileFilter.newFilterWithArchiveExtensions( 18 extensions, defaultExtension, description, addArchiveExtensionsToDescription); 19 assertEquals(expectedExtensions, ext.getExtensions()); 20 assertEquals(defaultExtension, ext.getDefaultExtension()); 21 assertEquals(expectedDescription, ext.getDescription()); 22 } 23 24 /** 25 * Unit test of method {@link ExtensionFileFilter#newFilterWithArchiveExtensions}. 26 */ 27 @Test 28 public void testNewFilterWithArchiveExtensions() { 29 test("ext1", "ext1", "description", true, 30 "ext1,ext1.gz,ext1.bz2", "description (*.ext1, *.ext1.gz, *.ext1.bz2)"); 31 test("ext1", "ext1", "description", false, 32 "ext1,ext1.gz,ext1.bz2", "description (*.ext1)"); 33 test("ext1,ext2", "ext1", "description", true, 34 "ext1,ext1.gz,ext1.bz2,ext2,ext2.gz,ext2.bz2", "description (*.ext1, *.ext1.gz, *.ext1.bz2, *.ext2, *.ext2.gz, *.ext2.bz2)"); 35 test("ext1,ext2", "ext1", "description", false, 36 "ext1,ext1.gz,ext1.bz2,ext2,ext2.gz,ext2.bz2", "description (*.ext1, *.ext2)"); 37 } 12 38 13 39 /** -
trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java
r9940 r10299 427 427 final SearchCompiler.Match c4 = SearchCompiler.compile("foo1 OR (bar1 bar2 baz1 XOR baz2) OR foo2"); 428 428 assertEquals("foo1 || (bar1 && bar2 && (baz1 ^ baz2)) || foo2", c4.toString()); 429 final SearchCompiler.Match c5 = SearchCompiler.compile("foo1 XOR (baz1 XOR (bar baz))"); 430 assertEquals("foo1 ^ baz1 ^ (bar && baz)", c5.toString()); 431 final SearchCompiler.Match c6 = SearchCompiler.compile("foo1 XOR ((baz1 baz2) XOR (bar OR baz))"); 432 assertEquals("foo1 ^ (baz1 && baz2) ^ (bar || baz)", c6.toString()); 429 433 } 430 434
Note:
See TracChangeset
for help on using the changeset viewer.