File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44package lr
55
66import (
7+ "bytes"
78 "os"
89 "testing"
910
@@ -281,11 +282,15 @@ func TestParseLR(t *testing.T) {
281282 absPath := "../../../providers/" + lrPath
282283
283284 t .Run (lrPath , func (t * testing.T ) {
285+ hasImports := false
284286 res , err := Resolve (absPath , func (path string ) ([]byte , error ) {
285287 raw , err := os .ReadFile (path )
286288 if err != nil {
287289 t .Fatal ("failed to load " + path + ":" + err .Error ())
288290 }
291+ if bytes .Contains (raw , []byte ("import \" " )) {
292+ hasImports = true
293+ }
289294 return raw , err
290295 })
291296 if err != nil {
@@ -305,6 +310,11 @@ func TestParseLR(t *testing.T) {
305310 t .Fatal ("failed to generate schema for " + lrPath + ":" + err .Error ())
306311 }
307312 assert .NotEmpty (t , schema )
313+ assert .NotEmpty (t , schema .Resources )
314+
315+ if hasImports {
316+ assert .NotEmpty (t , schema .Dependencies )
317+ }
308318 })
309319 }
310320}
You can’t perform that action at this time.
0 commit comments