diff options
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(); + } } |