Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 603080567
  • Loading branch information
cpovirk authored and Compile-Testing Team committed Jan 31, 2024
1 parent 6493d6f commit 5d3aaff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/test/java/com/google/testing/compile/CompilationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
package com.google.testing.compile;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;
import static com.google.testing.compile.CompilationSubject.assertThat;
import static com.google.testing.compile.Compiler.javac;
import static javax.tools.StandardLocation.SOURCE_OUTPUT;
import static org.junit.Assert.fail;

import com.google.common.collect.ImmutableList;
import com.google.common.truth.Truth8;
import javax.tools.JavaFileObject;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -75,21 +75,23 @@ public void compilerStatusFailure() {
public void generatedFilePath() {
Compiler compiler = compilerWithGenerator();
Compilation compilation = compiler.compile(source1, source2);
assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test/generated/Blah.java")).isPresent();
Truth8.assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test/generated/Blah.java"))
.isPresent();
}

@Test
public void generatedFilePackage() {
Compiler compiler = compilerWithGenerator();
Compilation compilation = compiler.compile(source1, source2);
assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test.generated", "Blah.java")).isPresent();
Truth8.assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test.generated", "Blah.java"))
.isPresent();
}

@Test
public void generatedSourceFile() {
Compiler compiler = compilerWithGenerator();
Compilation compilation = compiler.compile(source1, source2);
assertThat(compilation.generatedSourceFile("test.generated.Blah")).isPresent();
Truth8.assertThat(compilation.generatedSourceFile("test.generated.Blah")).isPresent();
}

private static Compiler compilerWithGenerator() {
Expand Down

0 comments on commit 5d3aaff

Please sign in to comment.