Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
smokedlinq committed Feb 27, 2025
1 parent 6f51d59 commit f8737de
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions internal/services/functions/unique_string_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,43 @@ func Test_UniqueStringFunction(t *testing.T) {
Result: function.NewResultData(types.StringValue("cwvxuqg24sifi")),
},
},
"unique-string-fu": {
request: function.RunRequest{
Arguments: function.NewArgumentsData([]attr.Value{
types.ListValueMust(types.StringType, []attr.Value{
types.StringValue("fu")
}),
}),
},
expected: function.RunResponse{
Result: function.NewResultData(types.StringValue("6rkxbspxjmsho")),
},
},
"unique-string-fubar": {
request: function.RunRequest{
Arguments: function.NewArgumentsData([]attr.Value{
types.ListValueMust(types.StringType, []attr.Value{
types.StringValue("fubar")
}),
}),
},
expected: function.RunResponse{
Result: function.NewResultData(types.StringValue("cj2xpqsiwjfne")),
},
},
"unique-string-fu-bar": {
request: function.RunRequest{
Arguments: function.NewArgumentsData([]attr.Value{
types.ListValueMust(types.StringType, []attr.Value{
types.StringValue("fu"),
types.StringValue("bar")
}),
}),
},
expected: function.RunResponse{
Result: function.NewResultData(types.StringValue("q5wxoscxs5j6k")),
},
},
}

for name, testCase := range testCases {
Expand Down

0 comments on commit f8737de

Please sign in to comment.