summaryrefslogtreecommitdiff
path: root/internal/funcs/data_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/funcs/data_test.go')
-rw-r--r--internal/funcs/data_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/funcs/data_test.go b/internal/funcs/data_test.go
new file mode 100644
index 00000000..c536beb3
--- /dev/null
+++ b/internal/funcs/data_test.go
@@ -0,0 +1,26 @@
+package funcs
+
+import (
+ "context"
+ "strconv"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestCreateDataFuncs(t *testing.T) {
+ t.Parallel()
+
+ for i := 0; i < 10; i++ {
+ // Run this a bunch to catch race conditions
+ t.Run(strconv.Itoa(i), func(t *testing.T) {
+ t.Parallel()
+
+ ctx := context.Background()
+ fmap := CreateDataFuncs(ctx, nil)
+ actual := fmap["data"].(func() interface{})
+
+ assert.Equal(t, ctx, actual().(*DataFuncs).ctx)
+ })
+ }
+}