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/events/LocationTest.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/events/LocationTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/events/LocationTest.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/events/LocationTest.java b/src/test/java/com/google/devtools/build/lib/events/LocationTest.java index 481ca8d0d0..2b32a63024 100644 --- a/src/test/java/com/google/devtools/build/lib/events/LocationTest.java +++ b/src/test/java/com/google/devtools/build/lib/events/LocationTest.java @@ -15,6 +15,7 @@ package com.google.devtools.build.lib.events; import static com.google.common.truth.Truth.assertThat; +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; @@ -33,7 +34,7 @@ public class LocationTest extends EventTestTemplate { assertThat(location.getEndLineAndColumn()).isNull(); assertThat(location.print()).isEqualTo(path + ":1"); } - + @Test public void testPrintRelative() throws Exception { Location location = Location.fromPathFragment(path); @@ -53,4 +54,14 @@ public class LocationTest extends EventTestTemplate { PathFragment.create("new"))) .isEqualTo("new:1"); } + + @Test + public void testCodec() throws Exception { + ObjectCodecTester.newBuilder(Location.CODEC) + .addSubjects( + Location.fromPathFragment(path), + Location.fromPathAndStartColumn(path, 0, 100, new Location.LineAndColumn(20, 25)), + Location.BUILTIN) + .buildAndRunTests(); + } } |