Skip to content

Commit 48fbd08

Browse files
committed
Use byte_size instead of String.length for trace_id validation
1 parent 6f56bc0 commit 48fbd08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test/sentry/opentelemetry/span_processor_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ defmodule Sentry.Opentelemetry.SpanProcessorTest do
115115

116116
defp assert_valid_trace_id(trace_id) do
117117
assert is_binary(trace_id), "Expected trace_id to be a string"
118-
assert String.length(trace_id) == 32, "Expected trace_id to be 32 characters long #{trace_id}"
118+
assert byte_size(trace_id) == 32, "Expected trace_id to be 32 characters long #{trace_id}"
119119

120120
assert String.match?(trace_id, ~r/^[a-f0-9]{32}$/),
121121
"Expected trace_id to be a lowercase hex string"

0 commit comments

Comments
 (0)