Skip to content

Commit

Permalink
Updating tests for ExpectKnownValue, ExpectKnownOutputValue and Expec…
Browse files Browse the repository at this point in the history
…tKnownOutputValueAtPaath (#243)
  • Loading branch information
bendbennett committed Jan 3, 2024
1 parent 5e61524 commit 41eb4de
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
26 changes: 13 additions & 13 deletions plancheck/expect_known_output_value_at_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_Bool_KnownValueWrongValue(t *tes
),
},
},
ExpectError: regexp.MustCompile("value: true does not equal expected value: false"),
ExpectError: regexp.MustCompile("expected value false for BoolValue check, got: true"),
},
},
})
Expand Down Expand Up @@ -340,7 +340,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_Float64_KnownValueWrongValue(t *
),
},
},
ExpectError: regexp.MustCompile("value: 1.23 does not equal expected value: 3.21"),
ExpectError: regexp.MustCompile("expected value 3.21 for Float64Value check, got: 1.23"),
},
},
})
Expand Down Expand Up @@ -421,7 +421,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_Int64_KnownValueWrongValue(t *te
),
},
},
ExpectError: regexp.MustCompile("value: 123 does not equal expected value: 321"),
ExpectError: regexp.MustCompile("expected value 321 for Int64Value check, got: 123"),
},
},
})
Expand Down Expand Up @@ -558,7 +558,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_List_KnownValueWrongValue(t *tes
),
},
},
ExpectError: regexp.MustCompile(`value: value1 does not equal expected value: value3`),
ExpectError: regexp.MustCompile(`list element index 0: expected value value3 for StringValue check, got: value1`),
},
},
})
Expand Down Expand Up @@ -651,7 +651,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_ListPartial_KnownValueWrongValue
),
},
},
ExpectError: regexp.MustCompile(`value: value1 does not equal expected value: value3`),
ExpectError: regexp.MustCompile(`list element 0: expected value value3 for StringValue check, got: value1`),
},
},
})
Expand Down Expand Up @@ -738,7 +738,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_ListNumElements_WrongNum(t *test
),
},
},
ExpectError: regexp.MustCompile("wrong length: 2, expected 3"),
ExpectError: regexp.MustCompile("expected 3 elements for ListElements check, got 2 elements"),
},
},
})
Expand Down Expand Up @@ -1021,7 +1021,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_Map_KnownValueWrongValue(t *test
),
},
},
ExpectError: regexp.MustCompile(`missing key: key3`),
ExpectError: regexp.MustCompile(`missing element key3 for MapValue check`),
},
},
})
Expand Down Expand Up @@ -1112,7 +1112,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_MapPartial_KnownValueWrongValue(
),
},
},
ExpectError: regexp.MustCompile(`missing key: key3`),
ExpectError: regexp.MustCompile(`missing element key3 for MapValuePartial check`),
},
},
})
Expand Down Expand Up @@ -1199,7 +1199,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_MapNumElements_WrongNum(t *testi
),
},
},
ExpectError: regexp.MustCompile("wrong length: 2, expected 3"),
ExpectError: regexp.MustCompile("expected 3 elements for MapElements check, got 2 elements"),
},
},
})
Expand Down Expand Up @@ -1292,7 +1292,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_Number_KnownValueWrongValue(t *t
),
},
},
ExpectError: regexp.MustCompile("value: 123 does not equal expected value: 321"),
ExpectError: regexp.MustCompile("expected value 321 for NumberValue check, got: 123"),
},
},
})
Expand Down Expand Up @@ -1385,7 +1385,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_Set_KnownValueWrongValue(t *test
),
},
},
ExpectError: regexp.MustCompile(`expected value not found: value3`),
ExpectError: regexp.MustCompile(`missing value value3 for SetValue check`),
},
},
})
Expand Down Expand Up @@ -1476,7 +1476,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_SetPartial_KnownValueWrongValue(
),
},
},
ExpectError: regexp.MustCompile(`expected value not found: value3`),
ExpectError: regexp.MustCompile(`missing value value3 for SetValuePartial check`),
},
},
})
Expand Down Expand Up @@ -1784,7 +1784,7 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_String_KnownValueWrongValue(t *t
knownvalue.StringValueExact("rts")),
},
},
ExpectError: regexp.MustCompile("value: str does not equal expected value: rts"),
ExpectError: regexp.MustCompile("expected value rts for StringValue check, got: str"),
},
},
})
Expand Down
26 changes: 13 additions & 13 deletions plancheck/expect_known_output_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestExpectKnownOutputValue_CheckPlan_Bool_KnownValueWrongValue(t *testing.T
),
},
},
ExpectError: regexp.MustCompile("value: true does not equal expected value: false"),
ExpectError: regexp.MustCompile("expected value false for BoolValue check, got: true"),
},
},
})
Expand Down Expand Up @@ -273,7 +273,7 @@ func TestExpectKnownOutputValue_CheckPlan_Float64_KnownValueWrongValue(t *testin
),
},
},
ExpectError: regexp.MustCompile("value: 1.23 does not equal expected value: 3.21"),
ExpectError: regexp.MustCompile("expected value 3.21 for Float64Value check, got: 1.23"),
},
},
})
Expand Down Expand Up @@ -338,7 +338,7 @@ func TestExpectKnownOutputValue_CheckPlan_Int64_KnownValueWrongValue(t *testing.
),
},
},
ExpectError: regexp.MustCompile("value: 123 does not equal expected value: 321"),
ExpectError: regexp.MustCompile("expected value 321 for Int64Value check, got: 123"),
},
},
})
Expand Down Expand Up @@ -451,7 +451,7 @@ func TestExpectKnownOutputValue_CheckPlan_List_KnownValueWrongValue(t *testing.T
),
},
},
ExpectError: regexp.MustCompile(`value: value1 does not equal expected value: value3`),
ExpectError: regexp.MustCompile(`list element index 0: expected value value3 for StringValue check, got: value1`),
},
},
})
Expand Down Expand Up @@ -528,7 +528,7 @@ func TestExpectKnownOutputValue_CheckPlan_ListPartial_KnownValueWrongValue(t *te
),
},
},
ExpectError: regexp.MustCompile(`value: value1 does not equal expected value: value3`),
ExpectError: regexp.MustCompile(`list element 0: expected value value3 for StringValue check, got: value1`),
},
},
})
Expand Down Expand Up @@ -599,7 +599,7 @@ func TestExpectKnownOutputValue_CheckPlan_ListNumElements_WrongNum(t *testing.T)
),
},
},
ExpectError: regexp.MustCompile("wrong length: 2, expected 3"),
ExpectError: regexp.MustCompile("expected 3 elements for ListElements check, got 2 elements"),
},
},
})
Expand Down Expand Up @@ -834,7 +834,7 @@ func TestExpectKnownOutputValue_CheckPlan_Map_KnownValueWrongValue(t *testing.T)
),
},
},
ExpectError: regexp.MustCompile(`missing key: key3`),
ExpectError: regexp.MustCompile(`missing element key3 for MapValue check`),
},
},
})
Expand Down Expand Up @@ -909,7 +909,7 @@ func TestExpectKnownOutputValue_CheckPlan_MapPartial_KnownValueWrongValue(t *tes
),
},
},
ExpectError: regexp.MustCompile(`missing key: key3`),
ExpectError: regexp.MustCompile(`missing element key3 for MapValuePartial check`),
},
},
})
Expand Down Expand Up @@ -980,7 +980,7 @@ func TestExpectKnownOutputValue_CheckPlan_MapNumElements_WrongNum(t *testing.T)
),
},
},
ExpectError: regexp.MustCompile("wrong length: 2, expected 3"),
ExpectError: regexp.MustCompile("expected 3 elements for MapElements check, got 2 elements"),
},
},
})
Expand Down Expand Up @@ -1057,7 +1057,7 @@ func TestExpectKnownOutputValue_CheckPlan_Number_KnownValueWrongValue(t *testing
),
},
},
ExpectError: regexp.MustCompile("value: 123 does not equal expected value: 321"),
ExpectError: regexp.MustCompile("expected value 321 for NumberValue check, got: 123"),
},
},
})
Expand Down Expand Up @@ -1134,7 +1134,7 @@ func TestExpectKnownOutputValue_CheckPlan_Set_KnownValueWrongValue(t *testing.T)
),
},
},
ExpectError: regexp.MustCompile(`expected value not found: value3`),
ExpectError: regexp.MustCompile(`missing value value3 for SetValue check`),
},
},
})
Expand Down Expand Up @@ -1209,7 +1209,7 @@ func TestExpectKnownOutputValue_CheckPlan_SetPartial_KnownValueWrongValue(t *tes
),
},
},
ExpectError: regexp.MustCompile(`expected value not found: value3`),
ExpectError: regexp.MustCompile(`missing value value3 for SetValuePartial check`),
},
},
})
Expand Down Expand Up @@ -1461,7 +1461,7 @@ func TestExpectKnownOutputValue_CheckPlan_String_KnownValueWrongValue(t *testing
knownvalue.StringValueExact("rts")),
},
},
ExpectError: regexp.MustCompile("value: str does not equal expected value: rts"),
ExpectError: regexp.MustCompile("expected value rts for StringValue check, got: str"),
},
},
})
Expand Down
26 changes: 13 additions & 13 deletions plancheck/expect_known_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestExpectKnownValue_CheckPlan_Bool_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile("value: true does not equal expected value: false"),
ExpectError: regexp.MustCompile("expected value false for BoolValue check, got: true"),
},
},
})
Expand Down Expand Up @@ -250,7 +250,7 @@ func TestExpectKnownValue_CheckPlan_Float64_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile("value: 1.23 does not equal expected value: 3.21"),
ExpectError: regexp.MustCompile("expected value 3.21 for Float64Value check, got: 1.23"),
},
},
})
Expand Down Expand Up @@ -309,7 +309,7 @@ func TestExpectKnownValue_CheckPlan_Int64_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile("value: 123 does not equal expected value: 321"),
ExpectError: regexp.MustCompile("expected value 321 for Int64Value check, got: 123"),
},
},
})
Expand Down Expand Up @@ -413,7 +413,7 @@ func TestExpectKnownValue_CheckPlan_List_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile(`value: value1 does not equal expected value: value3`),
ExpectError: regexp.MustCompile(`list element index 0: expected value value3 for StringValue check, got: value1`),
},
},
})
Expand Down Expand Up @@ -484,7 +484,7 @@ func TestExpectKnownValue_CheckPlan_ListPartial_KnownValueWrongValue(t *testing.
),
},
},
ExpectError: regexp.MustCompile(`value: value1 does not equal expected value: value3`),
ExpectError: regexp.MustCompile(`list element 0: expected value value3 for StringValue check, got: value1`),
},
},
})
Expand Down Expand Up @@ -549,7 +549,7 @@ func TestExpectKnownValue_CheckPlan_ListNumElements_WrongNum(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile("wrong length: 2, expected 3"),
ExpectError: regexp.MustCompile("expected 3 elements for ListElements check, got 2 elements"),
},
},
})
Expand Down Expand Up @@ -766,7 +766,7 @@ func TestExpectKnownValue_CheckPlan_Map_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile(`missing key: key3`),
ExpectError: regexp.MustCompile(`missing element key3 for MapValue check`),
},
},
})
Expand Down Expand Up @@ -835,7 +835,7 @@ func TestExpectKnownValue_CheckPlan_MapPartial_KnownValueWrongValue(t *testing.T
),
},
},
ExpectError: regexp.MustCompile(`missing key: key3`),
ExpectError: regexp.MustCompile(`missing element key3 for MapValuePartial check`),
},
},
})
Expand Down Expand Up @@ -900,7 +900,7 @@ func TestExpectKnownValue_CheckPlan_MapNumElements_WrongNum(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile("wrong length: 2, expected 3"),
ExpectError: regexp.MustCompile("expected 3 elements for MapElements check, got 2 elements"),
},
},
})
Expand Down Expand Up @@ -971,7 +971,7 @@ func TestExpectKnownValue_CheckPlan_Number_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile("value: 123 does not equal expected value: 321"),
ExpectError: regexp.MustCompile("expected value 321 for NumberValue check, got: 123"),
},
},
})
Expand Down Expand Up @@ -1042,7 +1042,7 @@ func TestExpectKnownValue_CheckPlan_Set_KnownValueWrongValue(t *testing.T) {
),
},
},
ExpectError: regexp.MustCompile(`expected value not found: value3`),
ExpectError: regexp.MustCompile(`missing value value3 for SetValue check`),
},
},
})
Expand Down Expand Up @@ -1111,7 +1111,7 @@ func TestExpectKnownValue_CheckPlan_SetPartial_KnownValueWrongValue(t *testing.T
),
},
},
ExpectError: regexp.MustCompile(`expected value not found: value3`),
ExpectError: regexp.MustCompile(`missing value value3 for SetValuePartial check`),
},
},
})
Expand Down Expand Up @@ -1342,7 +1342,7 @@ func TestExpectKnownValue_CheckPlan_String_KnownValueWrongValue(t *testing.T) {
knownvalue.StringValueExact("rts")),
},
},
ExpectError: regexp.MustCompile("value: str does not equal expected value: rts"),
ExpectError: regexp.MustCompile("expected value rts for StringValue check, got: str"),
},
},
})
Expand Down

0 comments on commit 41eb4de

Please sign in to comment.