From 75c30d2bb615ef73f181b5a17e987620c4a8fd72 Mon Sep 17 00:00:00 2001 From: mrAppleXZ Date: Sat, 28 Dec 2019 22:37:43 +0500 Subject: [PATCH] Add more tests --- .../net/pearx/kasechange/test/ComplexTest.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/commonTest/kotlin/net/pearx/kasechange/test/ComplexTest.kt b/src/commonTest/kotlin/net/pearx/kasechange/test/ComplexTest.kt index 055554f..f623227 100644 --- a/src/commonTest/kotlin/net/pearx/kasechange/test/ComplexTest.kt +++ b/src/commonTest/kotlin/net/pearx/kasechange/test/ComplexTest.kt @@ -3,6 +3,8 @@ package net.pearx.kasechange.test import net.pearx.kasechange.* import net.pearx.kasechange.formatter.CaseFormatterConfig import net.pearx.kasechange.formatter.CaseFormatterConfigurable +import net.pearx.kasechange.splitter.WordSplitter +import net.pearx.kasechange.splitter.WordSplitterConfig import kotlin.test.Test import kotlin.test.assertEquals @@ -63,7 +65,17 @@ class ComplexTest { } @Test - fun testMulti1() { + fun testCustom1() { assertEquals("My**Xml**Request**V2**Updated", "MY XML-REQUEST.V2_UPDATED".toCase(CaseFormatterConfig(false, "**", wordCapitalize = true, firstWordCapitalize = true), universalWordSplitter(false))) } + + @Test + fun testCustom2() { + assertEquals("My**Xml**Request**V2**Updated", "MY_XML_REQUEST_V2_UPDATED".toCase(CaseFormatterConfig(false, "**", wordCapitalize = true, firstWordCapitalize = true), CaseFormat.UPPER_UNDERSCORE)) + } + + @Test + fun testCustom3() { + assertEquals("My**Xml**Request**V2**Updated", "my*xml*request*v2*updated".toCase(CaseFormatterConfig(false, "**", wordCapitalize = true, firstWordCapitalize = true), WordSplitterConfig(boundaries = setOf('*')))) + } } \ No newline at end of file