Skip to content

Commit

Permalink
chore: increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy committed Aug 14, 2024
1 parent f0c9515 commit e6b60d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions datamodel/low/extraction_functions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,17 @@ func TestFromReferenceMap(t *testing.T) {
assert.Equal(t, "qux", om.GetOrZero("baz"))
}

func TestFromReferenceMapWithFunc(t *testing.T) {
refMap := orderedmap.New[KeyReference[string], ValueReference[string]]()
refMap.Set(KeyReference[string]{Value: "foo"}, ValueReference[string]{Value: "bar"})
refMap.Set(KeyReference[string]{Value: "baz"}, ValueReference[string]{Value: "quxor"})
var om *orderedmap.Map[string, int] = FromReferenceMapWithFunc(refMap, func(v string) int {
return len(v)
})
assert.Equal(t, 3, om.GetOrZero("foo"))
assert.Equal(t, 5, om.GetOrZero("baz"))
}

func TestAppendMapHashes(t *testing.T) {
m := orderedmap.New[KeyReference[string], ValueReference[string]]()
m.Set(KeyReference[string]{Value: "foo"}, ValueReference[string]{Value: "bar"})
Expand Down

0 comments on commit e6b60d8

Please sign in to comment.