From 7f40eb6ac47082acf1ecfaf34c5084f9351fa0ea Mon Sep 17 00:00:00 2001 From: John Kastner <130772734+john-h-kastner-aws@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:18:34 -0500 Subject: [PATCH] Fix warnings in tests due to camel case name (#1519) Signed-off-by: John Kastner --- .../src/cedar_schema/to_json_schema.rs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/cedar-policy-validator/src/cedar_schema/to_json_schema.rs b/cedar-policy-validator/src/cedar_schema/to_json_schema.rs index 74672faff..1b6e7c02c 100644 --- a/cedar-policy-validator/src/cedar_schema/to_json_schema.rs +++ b/cedar-policy-validator/src/cedar_schema/to_json_schema.rs @@ -721,52 +721,52 @@ mod preserves_source_locations { .get(&Some(Name::parse_unqualified_name("NS").unwrap())) .expect("couldn't find namespace NS"); - let entityA = ns + let entity_a = ns .entity_types .get(&"A".parse().unwrap()) .expect("couldn't find entity A"); - let entityB = ns + let entity_b = ns .entity_types .get(&"B".parse().unwrap()) .expect("couldn't find entity B"); - let entityC = ns + let entity_c = ns .entity_types .get(&"C".parse().unwrap()) .expect("couldn't find entity C"); - let ctypeS = ns + let ctype_s = ns .common_types .get(&json_schema::CommonTypeId::new("S".parse().unwrap()).unwrap()) .expect("couldn't find common type S"); - let ctypeAA = ns + let ctype_aa = ns .common_types .get(&json_schema::CommonTypeId::new("AA".parse().unwrap()).unwrap()) .expect("couldn't find common type AA"); - let actionRead = ns.actions.get("Read").expect("couldn't find action Read"); - let actionWrite = ns.actions.get("Write").expect("couldn't find action Write"); - let actionList = ns.actions.get("List").expect("couldn't find action List"); + let action_read = ns.actions.get("Read").expect("couldn't find action Read"); + let action_write = ns.actions.get("Write").expect("couldn't find action Write"); + let action_list = ns.actions.get("List").expect("couldn't find action List"); - assert_matches!(&entityA.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&entity_a.loc, Some(loc) => assert_matches!(loc.snippet(), Some("entity A;") )); - assert_matches!(&entityB.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&entity_b.loc, Some(loc) => assert_matches!(loc.snippet(), Some("entity B in A;") )); - assert_matches!(&entityC.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&entity_c.loc, Some(loc) => assert_matches!(loc.snippet(), Some("entity C in A {\n bool: Bool,\n s: S,\n a: Set,\n b: { inner: B },\n };") )); - assert_matches!(&ctypeS.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&ctype_s.loc, Some(loc) => assert_matches!(loc.snippet(), Some("type S = String;") )); - assert_matches!(&ctypeAA.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&ctype_aa.loc, Some(loc) => assert_matches!(loc.snippet(), Some("type AA = A;") )); - assert_matches!(&actionRead.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&action_read.loc, Some(loc) => assert_matches!(loc.snippet(), Some("action Read, Write;") )); - assert_matches!(&actionWrite.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&action_write.loc, Some(loc) => assert_matches!(loc.snippet(), Some("action Read, Write;") )); - assert_matches!(&actionList.loc, Some(loc) => assert_matches!(loc.snippet(), + assert_matches!(&action_list.loc, Some(loc) => assert_matches!(loc.snippet(), Some("action List in Read appliesTo {\n principal: [A],\n resource: [B, C],\n context: {\n s: Set,\n ab: { a: AA, b: B },\n }\n };") )); } @@ -846,16 +846,16 @@ mod preserves_source_locations { }); });}); - let ctypeAA = ns + let ctype_aa = ns .common_types .get(&json_schema::CommonTypeId::new("AA".parse().unwrap()).unwrap()) .expect("couldn't find common type AA"); - assert_matches!(ctypeAA.ty.loc(), Some(loc) => { + assert_matches!(ctype_aa.ty.loc(), Some(loc) => { assert_matches!(loc.snippet(), Some("A")); }); - let actionList = ns.actions.get("List").expect("couldn't find action List"); - assert_matches!(&actionList.applies_to, Some(appliesto) => { + let action_list = ns.actions.get("List").expect("couldn't find action List"); + assert_matches!(&action_list.applies_to, Some(appliesto) => { assert_matches!(appliesto.principal_types.first().expect("principal types were empty").loc(), Some(loc) => { assert_matches!(loc.snippet(), Some("A")); });