https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
n

natpryce

06/30/2017, 6:02 AM
Is that a bug?
b

bashor

06/30/2017, 10:42 AM
natpryce: could you show your identifiers?
n

natpryce

06/30/2017, 10:44 AM
They were tests. Like…
Copy code
fun `a test with spaces in its name`() { .. }
and
Copy code
fun `a test with spaces, and a comma`() { ... }
worse, IntellJ offers a refactoring to convert camelCaseNames to ``backticks and spaces``, but that refactoring stops the code compiling on the JS target
b

bashor

06/30/2017, 10:46 AM
please file an issue about wrong IDEA’s suggestion
n

natpryce

06/30/2017, 10:50 AM
IntelliJ’s suggestion is not a problem. In JS the test gets compiled to a QUnit test, like this:
Copy code
QUnit.test('ByteArraySpliceTest.can_mutate_the_replaced_bytes', function () {
    (new ByteArraySpliceTest()).can_mutate_the_replaced_bytes();
  });
and it’s fine for the test name to contain spaces.
b

bashor

06/30/2017, 10:52 AM
how do you get it if members with spaces prohibited?
n

natpryce

06/30/2017, 10:54 AM
Exactly! Tests are handled as a special case by the compiler. It should allow spaces in test function names. And then IntelliJ’s refactoring (which only applies to tests) would be appropriate.
4 Views