...
1 package subdir
2
3 import (
4 "context"
5 "os"
6 "testing"
7
8 "gotest.tools/v3/assert"
9
10 "edge-infra.dev/test/f2"
11 "edge-infra.dev/test/f2/examples/embed/sharingdata/shared"
12 )
13
14 var f f2.Framework
15
16 func TestMain(m *testing.M) {
17 f = f2.New(context.Background())
18 os.Exit(f.Run(m))
19 }
20
21 func TestSharedEmbed(t *testing.T) {
22 fin := f2.NewFeature("basic subdir embed feature").
23 Test("test subdir embed", func(ctx f2.Context, t *testing.T) f2.Context {
24 td := shared.TestData
25
26 data, err := td.ReadFile("testdata/c.txt")
27 assert.NilError(t, err)
28 assert.Equal(t, string(data), "aahh")
29
30 return ctx
31 }).Feature()
32
33 f.Test(t, fin)
34 }
35
View as plain text