-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
E211439A
authored and
E211439A
committed
Jan 12, 2024
1 parent
bcae87c
commit d039429
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
app/src/test/java/fr/medicapp/medicapp/ai/tokenization/CharCheckerTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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('-')) | ||
} | ||
|
||
} |