Skip to content

Commit

Permalink
insta::assert_display_snapshot() => insta::assert_snapshot()
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraettinger committed Apr 20, 2024
1 parent 31c3e2e commit 58b6948
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion crates/agent/src/discovers/specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ mod tests {

let out = super::merge_collections(discovered_bindings, fetched_collections, targets);

insta::assert_display_snapshot!(serde_json::to_string_pretty(&out).unwrap());
insta::assert_snapshot!(serde_json::to_string_pretty(&out).unwrap());
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions crates/derive-sqlite/src/dbutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ mod test {
|row| row.get(0),
)
.unwrap();
insta::assert_display_snapshot!(fixture_content, @r###"[{"id":4,"value":"hello"},{"id":5,"value":"updated"},{"thing":"hi","other":32},{"thing":"there","other":32},{"thing":"bye","other":42}]"###);
insta::assert_snapshot!(fixture_content, @r###"[{"id":4,"value":"hello"},{"id":5,"value":"updated"},{"thing":"hi","other":32},{"thing":"there","other":32},{"thing":"bye","other":42}]"###);
}

#[test]
Expand Down Expand Up @@ -377,6 +377,6 @@ mod test {
]
"###);

insta::assert_display_snapshot!(sql_block_to_statements("select 1; \0 select 2;").unwrap_err(), @"SQL block contains illegal NULL characters");
insta::assert_snapshot!(sql_block_to_statements("select 1; \0 select 2;").unwrap_err(), @"SQL block contains illegal NULL characters");
}
}
8 changes: 4 additions & 4 deletions crates/derive-sqlite/src/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,19 @@ mod test {
);
}

insta::assert_display_snapshot!(
insta::assert_snapshot!(
Param::resolve("$simplee", &params).unwrap_err(),
@"parameter $simplee not found: did you mean $Simple ?");

insta::assert_display_snapshot!(
insta::assert_snapshot!(
Param::resolve("$with$nesting", &params).unwrap_err(),
@"parameter $with$nesting not found: did you mean $With$Nesting ?");

insta::assert_display_snapshot!(
insta::assert_snapshot!(
Param::resolve("$With$Nesting$and_special_hyphen", &params).unwrap_err(),
@"parameter $With$Nesting$and_special_hyphen not found: did you mean $p::(With/Nesting/and+special-hyphen) ?");

insta::assert_display_snapshot!(
insta::assert_snapshot!(
Param::resolve("$way_off", &params).unwrap_err(),
@"parameter $way_off not found: did you mean $Simple ?");
}
Expand Down
2 changes: 1 addition & 1 deletion crates/derive-typescript/src/codegen/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,6 @@ mod test {
w.push_str("\n\n");
}

insta::assert_display_snapshot!(w);
insta::assert_snapshot!(w);
}
}
60 changes: 30 additions & 30 deletions crates/proto-flow/tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,179 +804,179 @@ fn proto_test<M: prost::Message + PartialEq + std::fmt::Debug + Default>(msg: M)
#[test]
fn test_collection_spec_json() {
let msg = ex_collection_spec();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_collection_spec_proto() {
let msg = ex_collection_spec();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_capture_spec_json() {
let msg = ex_capture_spec();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_capture_spec_proto() {
let msg = ex_capture_spec();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_derivation_spec_json() {
let msg = ex_derivation_spec();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_derivation_spec_proto() {
let msg = ex_derivation_spec();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_materialization_spec_json() {
let msg = ex_materialization_spec();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_materialization_spec_proto() {
let msg = ex_materialization_spec();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_test_spec_json() {
let msg = ex_test_spec();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_test_spec_proto() {
let msg = ex_test_spec();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_oauth2_json() {
let msg = ex_oauth2();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_oauth2_proto() {
let msg = ex_oauth2();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_shard_labeling_json() {
let msg = ex_shard_labeling();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_shard_labeling_proto() {
let msg = ex_shard_labeling();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_log_json() {
let msg = ex_log();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_log_proto() {
let msg = ex_log();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_stats_json() {
let msg = ex_stats();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_stats_proto() {
let msg = ex_stats();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_capture_request_json() {
let msg = ex_capture_request();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_capture_request_proto() {
let msg = ex_capture_request();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_capture_response_json() {
let msg = ex_capture_response();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_capture_response_proto() {
let msg = ex_capture_response();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_derive_request_json() {
let msg = ex_derive_request();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_derive_request_proto() {
let msg = ex_derive_request();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_derive_response_json() {
let msg = ex_derive_response();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_derive_response_proto() {
let msg = ex_derive_response();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_materialize_request_json() {
let msg = ex_materialize_request();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_materialize_request_proto() {
let msg = ex_materialize_request();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

#[test]
fn test_materialize_response_json() {
let msg = ex_materialize_response();
insta::assert_display_snapshot!(json_test(msg));
insta::assert_snapshot!(json_test(msg));
}

#[test]
fn test_materialize_response_proto() {
let msg = ex_materialize_response();
insta::assert_display_snapshot!(proto_test(msg));
insta::assert_snapshot!(proto_test(msg));
}

0 comments on commit 58b6948

Please sign in to comment.