veyron2/uniqueid: trim leading 0x if present in FromHexString input
Also fix formatting in vtrace trace ID output.
Change-Id: Ic5596a087d8402cb72f09319d7e647f91a46df18
diff --git a/tools/debug/testdata/integration_test.go b/tools/debug/testdata/integration_test.go
index 8216925..ed17bcc 100644
--- a/tools/debug/testdata/integration_test.go
+++ b/tools/debug/testdata/integration_test.go
@@ -185,9 +185,9 @@
}
traceId := fields[2]
- // Do a sanity check on the trace ID: it should be a 32-character hex ID.
- if match, _ := regexp.MatchString("[0-9a-f]{32}", traceId); !match {
- t.Fatalf("wanted a 32-character hex ID, got %s", traceId)
+ // Do a sanity check on the trace ID: it should be a 32-character hex ID prefixed with 0x
+ if match, _ := regexp.MatchString("0x[0-9a-f]{32}", traceId); !match {
+ t.Fatalf("wanted a 32-character hex ID prefixed with 0x, got %s", traceId)
}
// Do another traced read, this will generate a new trace entry.