Skip to content

Commit

Permalink
* improve test method names in helpers_pathsTests by means of `backti…
Browse files Browse the repository at this point in the history
…ck syntax`
  • Loading branch information
meisl committed Aug 2, 2021
1 parent f0c150d commit bd6c60c
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions compilerAst/test/helpers_pathsTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.assertThrows

import kotlin.io.path.*
import kotlin.test.assertContains


// Do not move into folder helpers/!
// This folder is also used by compiler/test
Expand All @@ -26,21 +26,21 @@ class PathsHelpersTests {
inner class WithOnePathArg {

@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThat("should return the path",
assumeNotExists(path), `is`(path))
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
assertThrows<java.lang.AssertionError> {
assumeNotExists(fixturesDir.div("simple_main.p8"))
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
assertThrows<java.lang.AssertionError> {
assumeNotExists(fixturesDir)
}
Expand All @@ -51,22 +51,22 @@ class PathsHelpersTests {
inner class WithOneStringArg {

@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThat("should return the path",
assumeNotExists("$path"), `is`(path))
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
val path = fixturesDir.div("simple_main.p8")
assertThrows<java.lang.AssertionError> {
assumeNotExists("$path")
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
assertThrows<java.lang.AssertionError> {
assumeNotExists("$fixturesDir")
}
Expand All @@ -77,21 +77,21 @@ class PathsHelpersTests {
inner class WithPathAndStringArgs {

@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThat("should return the path",
assumeNotExists(fixturesDir, "i_do_not_exist"), `is`(path))
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
assertThrows<java.lang.AssertionError> {
assumeNotExists(fixturesDir, "simple_main.p8")
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
assertThrows<java.lang.AssertionError> {
assumeNotExists(fixturesDir, "..")
}
Expand All @@ -105,23 +105,23 @@ class PathsHelpersTests {
@Nested
inner class WithOnePathArg {
@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThrows<AssertionError> {
assumeDirectory(path)
}
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
val path = fixturesDir.div("simple_main.p8")
assertThrows<AssertionError> {
assumeDirectory(path)
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
val path = workingDir
assertThat("should return the path", assumeDirectory(path), `is`(path))
}
Expand All @@ -130,23 +130,23 @@ class PathsHelpersTests {
@Nested
inner class WithOneStringArg {
@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThrows<AssertionError> {
assumeDirectory("$path")
}
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
val path = fixturesDir.div("simple_main.p8")
assertThrows<AssertionError> {
assumeDirectory("$path")
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
val path = workingDir
assertThat("should return the path",
assumeDirectory("$path"), `is`(path))
Expand All @@ -156,21 +156,21 @@ class PathsHelpersTests {
@Nested
inner class WithPathAndStringArgs {
@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
assertThrows<AssertionError> {
assumeDirectory(fixturesDir, "i_do_not_exist")
}
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
assertThrows<AssertionError> {
assumeDirectory(fixturesDir, "simple_main.p8")
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
val path = workingDir.div("..")
assertThat(
"should return resulting path",
Expand All @@ -182,21 +182,21 @@ class PathsHelpersTests {
@Nested
inner class WithStringAndStringArgs {
@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
assertThrows<AssertionError> {
assumeDirectory("$fixturesDir", "i_do_not_exist")
}
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
assertThrows<AssertionError> {
assumeDirectory("$fixturesDir", "simple_main.p8")
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
val path = workingDir.div("..")
assertThat(
"should return resulting path",
Expand All @@ -208,21 +208,21 @@ class PathsHelpersTests {
@Nested
inner class WithStringAndPathArgs {
@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
assertThrows<AssertionError> {
assumeDirectory("$fixturesDir", Path("i_do_not_exist"))
}
}

@Test
fun testOnExistingFile() {
fun `on existing file`() {
assertThrows<AssertionError> {
assumeDirectory("$fixturesDir", Path("simple_main.p8"))
}
}

@Test
fun testOnExistingDirectory() {
fun `on existing directory`() {
val path = workingDir.div("..")
assertThat(
"should return resulting path",
Expand All @@ -239,22 +239,22 @@ class PathsHelpersTests {
inner class WithOnePathArg {

@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThrows<AssertionError> {
assumeReadableFile(path)
}
}

@Test
fun testOnReadableFile() {
fun `on readable file`() {
val path = fixturesDir.div("simple_main.p8")
assertThat("should return the path",
assumeReadableFile(path), `is`(path))
}

@Test
fun testOnDirectory() {
fun `on directory`() {
assertThrows<AssertionError> {
assumeReadableFile(fixturesDir)
}
Expand All @@ -265,22 +265,22 @@ class PathsHelpersTests {
inner class WithOneStringArg {

@Test
fun testOnNonExistingPath() {
fun `on non-existing path`() {
val path = fixturesDir.div("i_do_not_exist")
assertThrows<AssertionError> {
assumeReadableFile("$path")
}
}

@Test
fun testOnReadableFile() {
fun `on readable file`() {
val path = fixturesDir.div("simple_main.p8")
assertThat("should return the resulting path",
assumeReadableFile("$path"), `is`(path))
}

@Test
fun testOnDirectory() {
fun `on directory`() {
assertThrows<AssertionError> {
assumeReadableFile("$fixturesDir")
}
Expand All @@ -290,21 +290,21 @@ class PathsHelpersTests {
@Nested
inner class WithPathAndStringArgs {
@Test
fun testOnNonexistingPath() {
fun `on non-existing path`() {
assertThrows<java.lang.AssertionError> {
assumeReadableFile(fixturesDir, "i_do_not_exist")
}
}

@Test
fun testOnReadableFile() {
fun `on readable file`() {
val path = fixturesDir.div("simple_main.p8")
assertThat("should return the resulting path",
assumeReadableFile(fixturesDir, "simple_main.p8"), `is`(path))
}

@Test
fun testOnDirectory() {
fun `on directory`() {
assertThrows<AssertionError> {
assumeReadableFile(fixturesDir, "..")
}
Expand All @@ -314,21 +314,21 @@ class PathsHelpersTests {
@Nested
inner class WithPathAndPathArgs {
@Test
fun testOnNonexistingPath() {
fun `on non-existing path`() {
assertThrows<java.lang.AssertionError> {
assumeReadableFile(fixturesDir, Path("i_do_not_exist"))
}
}

@Test fun testOnReadableFile() {
@Test fun `on readable file`() {
assertThat("should return the resulting path",
assumeReadableFile(fixturesDir, Path("simple_main.p8")),
`is`(fixturesDir.div("simple_main.p8"))
)
}

@Test
fun testOnDirectory() {
fun `on directory`() {
assertThrows<AssertionError> {
assumeReadableFile(fixturesDir, Path(".."))
}
Expand All @@ -338,22 +338,22 @@ class PathsHelpersTests {
@Nested
inner class WithStringAndStringArgs {
@Test
fun testOnNonexistingPath() {
fun `on non-existing path`() {
assertThrows<java.lang.AssertionError> {
assumeReadableFile("$fixturesDir", "i_do_not_exist")
}
}

@Test
fun testOnReadableFile() {
fun `on readable file`() {
assertThat("should return the resulting path",
assumeReadableFile(fixturesDir.toString(), "simple_main.p8"),
`is`(fixturesDir.div("simple_main.p8"))
)
}

@Test
fun testOnDirectory() {
fun `on directory`() {
assertThrows<AssertionError> {
assumeReadableFile("$fixturesDir", "..")
}
Expand Down

0 comments on commit bd6c60c

Please sign in to comment.