Skip to content

Commit e8b875e

Browse files
committed
test fixtures
1 parent d4fb644 commit e8b875e

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

nextcontrol/build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ plugins {
3131
`java-library`
3232

3333
`maven-publish`
34+
35+
//allows for a test fixture source set (which is published to maven) that is accessible from the test source set
36+
`java-test-fixtures`
3437
}
3538

3639
repositories {
@@ -47,6 +50,9 @@ dependencies {
4750
testImplementation(libs.kotest.runner)
4851
testImplementation(libs.kotest.assertions)
4952
testImplementation(libs.kotest.property)
53+
testFixturesImplementation(libs.kotest.runner)
54+
testFixturesImplementation(libs.kotest.assertions)
55+
testFixturesImplementation(libs.kotest.property)
5056
}
5157

5258
// Apply a specific Java toolchain to ease working on different environments.
@@ -75,4 +81,4 @@ publishing {
7581
url = uri("../../maven.rowanmcalpin.com")
7682
}
7783
}
78-
}
84+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* NextFTC: a user-friendly control library for FIRST Tech Challenge
3+
* Copyright (C) 2025 Rowan McAlpin
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package dev.nextftc.nextcontrol.test
20+
21+
import dev.nextftc.nextcontrol.KineticState
22+
import io.kotest.property.arbitrary.arbitrary
23+
24+
val kineticStateGen = arbitrary {
25+
KineticState(
26+
it.random.nextDouble(),
27+
it.random.nextDouble(),
28+
it.random.nextDouble()
29+
)
30+
}

0 commit comments

Comments
 (0)