File tree Expand file tree Collapse file tree
graphs/implicit-resource-import Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ impl GraphFile {
171171 path = path. display( )
172172 )
173173 } ) ?,
174+ None if path. is_dir ( ) => Self :: load_wit_package ( test_case, & path) ?,
174175 _ => bail ! (
175176 "unexpected file extension for package file `{path}`" ,
176177 path = package. path. display( )
@@ -331,6 +332,7 @@ fn encoding() -> Result<()> {
331332 } ) ?
332333 . into_composition_graph ( & path, test_case)
333334 . and_then ( |graph| {
335+ println ! ( "{:?}" , graph) ;
334336 graph
335337 . encode ( EncodeOptions {
336338 // We import the component definitions instead
Original file line number Diff line number Diff line change 1+ package foo : dependency ;
2+
3+ interface types {
4+ resource x ;
5+ }
6+
7+ world w {
8+ export types ;
9+ }
Original file line number Diff line number Diff line change 1+ package foo : bar ;
2+
3+ world w {
4+ export foo :dependency /types ;
5+ }
Original file line number Diff line number Diff line change 1+ package foo : dependency ;
2+
3+ interface types {
4+ resource x ;
5+ }
6+
7+ world w {
8+ export types ;
9+ }
Original file line number Diff line number Diff line change 1+ package foo : baz ;
2+
3+ world w {
4+ use foo :dependency /types . {x };
5+ import my-func : func () -> x ;
6+ // The test will fail whether this is here or not
7+ import foo :dependency /types ;
8+ }
Original file line number Diff line number Diff line change 1+ {
2+ "packages" : [
3+ {
4+ "name" : " foo:import" ,
5+ "path" : " import"
6+ },
7+ {
8+ "name" : " test:bar" ,
9+ "path" : " bar"
10+ },
11+ {
12+ "name" : " test:baz" ,
13+ "path" : " baz"
14+ }
15+ ],
16+ "nodes" : [
17+ {
18+ "type" : " import" ,
19+ "name" : " foo:test-import/my-interface" ,
20+ "package" : 0 ,
21+ "export" : " foo:test-import/my-interface"
22+ },
23+ {
24+ "type" : " instantiation" ,
25+ "package" : 1
26+ },
27+ {
28+ "type" : " alias" ,
29+ "source" : 0 ,
30+ "export" : " my-func"
31+ },
32+ {
33+ "type" : " alias" ,
34+ "source" : 1 ,
35+ "export" : " foo:dependency/types"
36+ },
37+ {
38+ "type" : " instantiation" ,
39+ "package" : 2
40+ }
41+ ],
42+ "arguments" : [
43+ {
44+ "source" : 2 ,
45+ "target" : 4 ,
46+ "name" : " my-func"
47+ },
48+ {
49+ "source" : 3 ,
50+ "target" : 4 ,
51+ "name" : " foo:dependency/types"
52+ }
53+ ]
54+ }
Original file line number Diff line number Diff line change 1+ package foo : dependency ;
2+
3+ interface types {
4+ resource x ;
5+ }
6+
7+ world w {
8+ export types ;
9+ }
Original file line number Diff line number Diff line change 1+ package foo : test-import ;
2+
3+ world w {
4+ export my-interface ;
5+ }
6+
7+ interface my-interface {
8+ use foo :dependency /types . {x };
9+ my-func : func () -> x ;
10+ }
You can’t perform that action at this time.
0 commit comments