From d0394294bfe033449b2c0bded73d987bf21a3257 Mon Sep 17 00:00:00 2001 From: E211439A Date: Fri, 12 Jan 2024 12:05:03 +0100 Subject: [PATCH] CharCheckerTest en cours --- .idea/sonarlint/issuestore/index.pb | 4 ++- .idea/sonarlint/securityhotspotstore/index.pb | 4 ++- .../ai/tokenization/CharCheckerTest.kt | 34 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 app/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb index eb5cb128..02bd1b3f 100644 --- a/.idea/sonarlint/issuestore/index.pb +++ b/.idea/sonarlint/issuestore/index.pb @@ -76,4 +76,6 @@ Happ/src/main/java/fr/medicapp/medicapp/ai/tokenization/BasicTokenizer.kt,3\2\3 D app/build.gradle.kts,d\2\d2a4383452aad84a18429a5844d31330a012a9e6 u -Eapp/src/main/java/fr/medicapp/medicapp/ai/tokenization/CharChecker.kt,4\3\4360b27ad914be271890809c2fa9825a9fa585ea \ No newline at end of file +Eapp/src/main/java/fr/medicapp/medicapp/ai/tokenization/CharChecker.kt,4\3\4360b27ad914be271890809c2fa9825a9fa585ea +y +Iapp/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt,c\2\c260ed506bde8cd6cc837e984a94b79b0f78d343 \ No newline at end of file diff --git a/.idea/sonarlint/securityhotspotstore/index.pb b/.idea/sonarlint/securityhotspotstore/index.pb index 0c037dc0..2291a1ff 100644 --- a/.idea/sonarlint/securityhotspotstore/index.pb +++ b/.idea/sonarlint/securityhotspotstore/index.pb @@ -220,4 +220,6 @@ h f 6app/src/main/java/fr/medicapp/medicapp/model/Doctor.kt,7/3/73a0c7304054cc5a13d1e3b198e48d6f56399848 | -Lapp/src/test/java/fr/medicapp/medicapp/ai/tokenization/BasicTokenizerTest.kt,6\8\68c13a7387c3734c70003723144659f87a284790 \ No newline at end of file +Lapp/src/test/java/fr/medicapp/medicapp/ai/tokenization/BasicTokenizerTest.kt,6\8\68c13a7387c3734c70003723144659f87a284790 +y +Iapp/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt,c\2\c260ed506bde8cd6cc837e984a94b79b0f78d343 \ No newline at end of file diff --git a/app/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt b/app/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt new file mode 100644 index 00000000..1dc8213c --- /dev/null +++ b/app/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt @@ -0,0 +1,34 @@ +package fr.medicapp.medicapp.ai.tokenization + +import fr.medicapp.medicapp.tokenization.CharChecker +import org.junit.Test + +class CharCheckerTest { + + @Test + fun `test CharChecker isInvalid with valid char`() { + assert(!CharChecker.isInvalid('a')) + } + + @Test + fun `test CharChecker isInvalid with void char`() { + assert(CharChecker.isInvalid(Char(0))) + } + + @Test + fun `test CharChecker isInvalid with invalid char`() { + val char = Char(0xfffd) + assert(CharChecker.isInvalid(char)) + } + + @Test + fun `test isPunctuation point`() { + assert(CharChecker.isPunctuation('.')) + } + + @Test + fun `test isPunctuation dash`() { + assert(CharChecker.isPunctuation('-')) + } + +} \ No newline at end of file