konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 261 forks source link

Implement String.chars() #872

Closed JFronny closed 6 months ago

JFronny commented 7 months ago

Simple implementation inspired by toCharArray. Seems to work fine from my testing.

konsoletyper commented 7 months ago

This PR lacks tests

JFronny commented 7 months ago

What copyright owner should be specified in the license header of the stream class?

konsoletyper commented 7 months ago

What copyright owner should be specified in the license header of the stream class?

You can specify your own name. Or you can also implement stream with inner class.

JFronny commented 7 months ago

This PR lacks tests

I have implemented a simple test. How would I go about running it? The documentation mentions setup steps, but not how I would actually run the tests. (gradlew test causes a bunch of ExceptionInInitializerErrors, so I assume that using that is not intended)

konsoletyper commented 7 months ago

You should follow instructions in https://teavm.org/docs/contributing/testing.html and then run tests using your favourite way. You can just launch ./gradlew test from console. Personally, I use IDEA for development and just press launch button across test method.

JFronny commented 7 months ago

The issue seems to be that the test runner expects Google Chrome to be installed with a specific name and crashes when it can't find it. Using -Pteavm.tests.browser=browser and manually opening the browser works, though.