Skip to content

Commit 6c37d3b

Browse files
committed
Add missing JavacJctFlagBuilderImpl test cases for DebuggingInfo flag combinations
1 parent 2207517 commit 6c37d3b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/impl/JavacJctFlagBuilderImplTest.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.junit.jupiter.api.Test;
3636
import org.junit.jupiter.api.TestMethodOrder;
3737
import org.junit.jupiter.params.ParameterizedTest;
38+
import org.junit.jupiter.params.provider.CsvSource;
3839
import org.junit.jupiter.params.provider.EnumSource;
3940
import org.junit.jupiter.params.provider.ValueSource;
4041

@@ -381,8 +382,23 @@ void emptySetAddsGnoneFlag() {
381382
}
382383

383384
@DisplayName("Setting .debuggingInfo with some values set adds the '-g:xxx' flags")
385+
@CsvSource({
386+
" LINES, -g:lines",
387+
"SOURCE, -g:source",
388+
" VARS, -g:vars",
389+
})
390+
@ParameterizedTest(name = "expect {0} to set flag {1}")
391+
void correctFlagsAreSet(DebuggingInfo flag, String flagString) {
392+
// When
393+
flagBuilder.debuggingInfo(DebuggingInfo.just(flag));
394+
395+
// Then
396+
assertThat(flagBuilder.build()).containsExactly(flagString);
397+
}
398+
399+
@DisplayName("Setting .debuggingInfo with all values set adds the '-g:xxx' flags")
384400
@Test
385-
void nonEmptySetAddsValues() {
401+
void allAddsValues() {
386402
// When
387403
flagBuilder.debuggingInfo(DebuggingInfo.all());
388404

0 commit comments

Comments
 (0)