v0.0.480
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m20s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m20s
This commit is contained in:
parent
b464afae01
commit
19d943361b
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.479"
|
const GoextVersion = "0.0.480"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2024-07-02T11:29:47+0200"
|
const GoextVersionTimestamp = "2024-07-02T11:32:22+0200"
|
||||||
|
@ -233,3 +233,27 @@ func TestAccessStructByArrayPath_UsedTagForKeysInvalid(t *testing.T) {
|
|||||||
t.Errorf("Expected error, got nil")
|
t.Errorf("Expected error, got nil")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DifferentTypeStruct struct {
|
||||||
|
Name string
|
||||||
|
Age int
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAccessStructByArrayPath_DifferentType(t *testing.T) {
|
||||||
|
testStruct := DifferentTypeStruct{Name: "John", Age: 30}
|
||||||
|
result, err := AccessStructByArrayPath[any](testStruct, []string{"Age"})
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
if result != 30 {
|
||||||
|
t.Errorf("Expected '30', got '%v'", result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAccessStructByArrayPath_DifferentTypeInvalid(t *testing.T) {
|
||||||
|
testStruct := DifferentTypeStruct{Name: "John", Age: 30}
|
||||||
|
_, err := AccessStructByArrayPath[any](testStruct, []string{"Invalid"})
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("Expected error, got nil")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user