Hi friends! I have a test in my `commonTest/` tha...
# multiplatform
p
Hi friends! I have a test in my
commonTest/
that relies on the
kotlin.test
framework. I have 4 tests that should have different behaviours when running on Windows and Unix. Is there something available in
kotlin.test
that I could use to skip the test if, e.g, running on Windows? Maybe something like JUnit's
assumeThat
. That way I could transform these 4 tests into 8 tests, 4 for each platform. 😊 Thanks!
h
You can use expect/actual to define a platform constant that can be used in @Ignore. Or just move the platform specific tests into the platform specific test folder.
gratitude thank you 1
Or only the platform validation logic.
gratitude thank you 1
p
Thanks @hfhbd! My original code had a
System.getProperty("os.name")
check that helped me choose different paths for Windows and Unix (e.g,
C:/foo
and
/foo
). I'll go with that. 😉