hello, i tried to google, but did not find anythin...
# getting-started
s
hello, i tried to google, but did not find anything. a want to make a real long fun name for my unit test, but met an error (screenshot) It happens only with a really long name of fun. Can i overcome it somehow?
j
It looks like you have some sort of class inside the function (maybe a lambda) and the problem is writing the compiled code of that class to a
.class
file. Maybe the OS doesn't support that name length? (that, or maybe an actual permission issue?)
e
macos and windows filenames are limited to around 255 characters, and the classname there exceeds the limit by a lot
j
But anyway the real question is... are you serious about that test function name? 😄
s
@Joffrey i think u are right. just tried to create a folder with a such name in xos and it failed
it could be much easier for me to maintain these tests. mb im wrong. any way i should to fix naming now 🙂
p
what test framework? e.g. JUnit has `@DisplayName`https://junit.org/junit5/docs/current/user-guide/#writing-tests-display-names that might not be part of the literal class output
e
anyhow, there is a ticket https://youtrack.jetbrains.com/issue/KT-17433 but no resolution, so please avoid excessively long names or excessive nesting
t
have a look at kotest maybe, there you more test styles available you do something like
Copy code
given("a single resource with both data sources") {
  `when`("always read policy"){
    and("query query from single resource from local data source failed") {
      //you get the gist
    }
  }
}
https://github.com/kotest/kotest/blob/master/doc/styles.md#behavior-spec the level of nesting would depend on which scenarios you are testing, it could help with reusability of code as well. might help you with this long complex and descriptive approach
and if you are not aware, #kotest is here as well