Debian Codegraph @

tests/cli/component-model-async/names.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots % -f cm-async
2
3 (component
4 (import "[async]f" (func))
5 (import "r" (type $r (sub resource)))
6 (import "[async method]r.f" (func (param "self" (borrow $r))))
7 (import "[async static]r.f2" (func))
8 )
9
10 ;; name conflicts where the "base kebab name" only differs on abi/etc and these
11 ;; should all conflict with one another.
12
13 (assert_invalid
14 (component
15 (import "[async]f" (func))
16 (import "f" (func))
17 )
18 "conflicts with previous name")
19
20 (assert_invalid
21 (component
22 (import "f" (func))
23 (import "[async]f" (func))
24 )
25 "conflicts with previous name")
26
27 (assert_invalid
28 (component
29 (import "r" (type $r (sub resource)))
30 (import "[method]r.f" (func (param "self" (borrow $r))))
31 (import "[async static]r.f" (func)))
32 "conflicts with previous name")
33
34 (assert_invalid
35 (component
36 (import "r" (type $r (sub resource)))
37 (import "[method]r.f" (func (param "self" (borrow $r))))
38 (import "[async method]r.f" (func (param "self" (borrow $r)))))
39 "conflicts with previous name")
40
41 (assert_invalid
42 (component
43 (import "r" (type $r (sub resource)))
44 (import "[method]r.f" (func (param "self" (borrow $r))))
45 (import "[async static]r.f" (func)))
46 "conflicts with previous name")
47
48 (assert_invalid
49 (component
50 (import "r" (type $r (sub resource)))
51 (import "[async method]r.f" (func (param "self" (borrow $r))))
52 (import "[async method]r.f" (func (param "self" (borrow $r)))))
53 "conflicts with previous name")
54
55 (assert_invalid
56 (component
57 (import "r" (type $r (sub resource)))
58 (import "[async method]r.f" (func (param "self" (borrow $r))))
59 (import "[static]r.f" (func)))
60 "conflicts with previous name")
61
62 (assert_invalid
63 (component
64 (import "r" (type $r (sub resource)))
65 (import "[async method]r.f" (func (param "self" (borrow $r))))
66 (import "[async static]r.f" (func)))
67 "conflicts with previous name")
68
69 (assert_invalid
70 (component
71 (import "r" (type $r (sub resource)))
72 (import "[async static]r.f" (func))
73 (import "[static]r.f" (func)))
74 "conflicts with previous name")
75
76 (assert_invalid
77 (component
78 (import "a" (type $a (sub resource)))
79 (import "[async method]a.a" (func (param "self" (borrow $a))))
80 )
81 "import name `[async method]a.a` conflicts with previous name `a`")
82
83 (assert_invalid
84 (component
85 (import "a" (type $a (sub resource)))
86 (import "[async static]a.a" (func))
87 )
88 "import name `[async static]a.a` conflicts with previous name `a`")