https://github.com/kerelape/test.kt
Get rid of test 'classes' and methods
https://github.com/kerelape/test.kt
dsl kotlin test testing testing-tools
Last synced: 21 days ago
JSON representation
Get rid of test 'classes' and methods
- Host: GitHub
- URL: https://github.com/kerelape/test.kt
- Owner: kerelape
- License: mit
- Created: 2022-04-28T19:02:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-28T19:43:06.000Z (about 4 years ago)
- Last Synced: 2025-02-28T22:41:13.626Z (over 1 year ago)
- Topics: dsl, kotlin, test, testing, testing-tools
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test.kt
Test library for kotlin (and other JVM languages)
#### Example
```kotlin
// src/test/Greeting.test.kts
test(Greeting::class) {
// Arbitary test
"can greet a random person" {
Assertion { // Every test must return an Assertion object (fun interface Assertion, with one method, assert returning Boolean)
Greeting("somebody").print() == "Hello, somebody!"
}
}
// Test that runs the block and returns true if the block fails
fails "with empty name" {
Greeting("").print()
}
can "print random name" {
val name = listOf("John", "David", "Jake").random()
equal(
Greeting(name).print(),
name
)
}
}
```