diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/src/lombok/RunAllTests.java | 4 | ||||
-rw-r--r-- | test/core/src/lombok/core/RunCoreTests.java | 31 | ||||
-rw-r--r-- | test/core/src/lombok/core/TestSingulars.java | 52 |
3 files changed, 85 insertions, 2 deletions
diff --git a/test/core/src/lombok/RunAllTests.java b/test/core/src/lombok/RunAllTests.java index 9f56b45b..1ca76af5 100644 --- a/test/core/src/lombok/RunAllTests.java +++ b/test/core/src/lombok/RunAllTests.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2014 The Project Lombok Authors. + * Copyright (C) 2011-2015 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,6 @@ import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) -@SuiteClasses({lombok.transform.RunTransformTests.class, lombok.bytecode.RunBytecodeTests.class, lombok.core.configuration.RunConfigurationTests.class}) +@SuiteClasses({lombok.transform.RunTransformTests.class, lombok.bytecode.RunBytecodeTests.class, lombok.core.configuration.RunConfigurationTests.class, lombok.core.RunCoreTests.class}) public class RunAllTests { } diff --git a/test/core/src/lombok/core/RunCoreTests.java b/test/core/src/lombok/core/RunCoreTests.java new file mode 100644 index 00000000..8ac7cf81 --- /dev/null +++ b/test/core/src/lombok/core/RunCoreTests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2015 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.core; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(Suite.class) +@SuiteClasses({TestSingulars.class}) +public class RunCoreTests { +} diff --git a/test/core/src/lombok/core/TestSingulars.java b/test/core/src/lombok/core/TestSingulars.java new file mode 100644 index 00000000..7e5e2617 --- /dev/null +++ b/test/core/src/lombok/core/TestSingulars.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2015 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.core; + +import static lombok.core.handlers.Singulars.autoSingularize; +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class TestSingulars { + @Test + public void testSingulars() { + assertEquals("axis", autoSingularize("axes")); + assertEquals("adjective", autoSingularize("adjectives")); + assertEquals("bus", autoSingularize("buses")); + assertEquals("octopus", autoSingularize("octopodes")); + assertEquals(null, autoSingularize("octopi")); + assertEquals("elf", autoSingularize("elves")); + assertEquals("jack", autoSingularize("jacks")); + assertEquals("colloquy", autoSingularize("colloquies")); + assertEquals(null, autoSingularize("series")); + assertEquals("man", autoSingularize("men")); + assertEquals(null, autoSingularize("highwaymen")); + assertEquals("caveMan", autoSingularize("caveMen")); + assertEquals(null, autoSingularize("jackss")); + assertEquals(null, autoSingularize("virus")); + assertEquals("quiz", autoSingularize("quizzes")); + assertEquals("database", autoSingularize("databases")); + assertEquals("dataBase", autoSingularize("dataBases")); + assertEquals("Query", autoSingularize("Queries")); + assertEquals("Movie", autoSingularize("Movies")); + } +} |