diff options
author | 2018-01-16 18:21:16 -0800 | |
---|---|---|
committer | 2018-01-16 18:22:48 -0800 | |
commit | 7ac7b63c658509fd335db6f0149da8e2786c488a (patch) | |
tree | 04bf7c852fc0137ace91ce568c7a4a268396ed79 /src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java | |
parent | 6f95124c3453006149eac955d7620540c7d6bda4 (diff) |
Codec for Location.
* Moves SingletonCodec to third_party.
PiperOrigin-RevId: 182143153
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java b/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java index 8d9318f071..c07d44b2d5 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java @@ -21,6 +21,7 @@ import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.EventKind; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.events.Reporter; +import com.google.devtools.build.lib.skyframe.serialization.testutils.ObjectCodecTester; import com.google.devtools.build.lib.vfs.PathFragment; import org.junit.Test; import org.junit.runner.RunWith; @@ -494,4 +495,11 @@ public class LexerTest { assertThat(names(tokens("r'\\"))).isEqualTo("STRING NEWLINE EOF"); assertThat(lastError).isEqualTo("/some/path.txt:1: unterminated string literal at eof"); } + + @Test + public void testLexerLocationCodec() throws Exception { + ObjectCodecTester.newBuilder(Location.CODEC) + .addSubjects(createLexer("foo").createLocation(0, 2)) + .buildAndRunTests(); + } } |