Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Jul 11, 2023
1 parent 58dff9d commit 376cb7e
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions relay-sampling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3331,19 +3331,6 @@ mod tests {
"###);
}

#[test]
fn test_parse_sampled_with_incoming_invalid_boolean() {
let json = r#"
{
"trace_id": "00000000-0000-0000-0000-000000000000",
"public_key": "abd0f232775f45feab79864e580d160b",
"user_id": "hello",
"sampled": tru
}
"#;
serde_json::from_str::<DynamicSamplingContext>(json).unwrap_err();
}

#[test]
fn test_parse_sampled_with_incoming_invalid_boolean_as_string() {
let json = r#"
Expand All @@ -3354,7 +3341,18 @@ mod tests {
"sampled": "tru"
}
"#;
serde_json::from_str::<DynamicSamplingContext>(json).unwrap_err();
let dsc = serde_json::from_str::<DynamicSamplingContext>(json).unwrap();
insta::assert_ron_snapshot!(dsc, @r###"
{
"trace_id": "00000000-0000-0000-0000-000000000000",
"public_key": "abd0f232775f45feab79864e580d160b",
"release": None,
"environment": None,
"transaction": None,
"user_id": "hello",
"replay_id": None,
}
"###);
}

#[test]
Expand Down

0 comments on commit 376cb7e

Please sign in to comment.