File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module github.com/openmcp-project/openmcp-testing
33go 1.25.2
44
55require (
6+ github.com/stretchr/testify v1.10.0
67 github.com/vladimirvivien/gexe v0.4.1
78 k8s.io/api v0.34.2
89 k8s.io/apimachinery v0.34.2
@@ -16,6 +17,7 @@ require (
1617 github.com/BurntSushi/toml v1.4.0 // indirect
1718 github.com/mattn/go-isatty v0.0.20 // indirect
1819 github.com/pelletier/go-toml v1.9.5 // indirect
20+ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
1921 go.yaml.in/yaml/v2 v2.4.2 // indirect
2022 go.yaml.in/yaml/v3 v3.0.4 // indirect
2123 sigs.k8s.io/randfill v1.0.0 // indirect
Original file line number Diff line number Diff line change 1+ hello openmcp!
Original file line number Diff line number Diff line change 1+ package internal
2+
3+ import (
4+ "bufio"
5+ "embed"
6+ "os"
7+ "testing"
8+
9+ "github.com/stretchr/testify/require"
10+ )
11+
12+ //go:embed testdata/test.txt
13+ var testFS embed.FS
14+
15+ func TestMustTmpFileFromEmbedFS (t * testing.T ) {
16+ result := MustTmpFileFromEmbedFS (testFS , "testdata/test.txt" )
17+ file , err := os .Open (result )
18+ require .NoError (t , err )
19+ scanner := bufio .NewScanner (file )
20+ require .True (t , scanner .Scan ())
21+ require .Equal (t , scanner .Text (), "hello openmcp!" )
22+ os .RemoveAll (result )
23+ }
You can’t perform that action at this time.
0 commit comments