Skip to content

Commit 6d2a8d6

Browse files
committed
chore: workaround wit-bindgen-go bug
Rename `var::var` to `var::some` to workaround naming bug https://github.com/bytecodealliance/wasm-tools-go/issues/215 Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 22d1344 commit 6d2a8d6

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

tests/go/sync/bindings/wadge-test/sync/guest/guest.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface sync {
44
flags abc { a, b, c }
55
record rec-nested { foo: string }
66
record rec { nested: rec-nested }
7-
variant var { var(rec), empty }
7+
variant var { some(rec), empty }
88
enum foobar { foo, bar }
99
record primitives {
1010
a: u8,

tests/go/sync/bindings/wadge-test/sync/sync/abi.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/go/sync/bindings/wadge-test/sync/sync/sync.wit.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/go/sync/sync_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ func TestIdentityVariant(t *testing.T) {
213213
t.Run("var", func(t *testing.T) {
214214
t.Run("empty", func(t *testing.T) {
215215
wadge.RunTest(t, func() {
216-
expected := sync.VarVar(sync.Rec{})
216+
expected := sync.VarSome(sync.Rec{})
217217
assert.Equal(t, expected,
218218
sync.IdentityVariant(expected),
219219
)
220220
})
221221
})
222222
t.Run("foo", func(t *testing.T) {
223223
wadge.RunTest(t, func() {
224-
expected := sync.VarVar(sync.Rec{
224+
expected := sync.VarSome(sync.Rec{
225225
Nested: sync.RecNested{
226226
Foo: "foo",
227227
},
@@ -528,15 +528,15 @@ func TestIdentityListVariant(t *testing.T) {
528528
})
529529
t.Run("[var(empty)]", func(t *testing.T) {
530530
wadge.RunTest(t, func() {
531-
expected := []sync.Var{sync.VarVar(sync.Rec{})}
531+
expected := []sync.Var{sync.VarSome(sync.Rec{})}
532532
assert.Equal(t, expected,
533533
sync.IdentityListVariant(cm.NewList(unsafe.SliceData(expected), 1)).Slice(),
534534
)
535535
})
536536
})
537537
t.Run("[var(foo)]", func(t *testing.T) {
538538
wadge.RunTest(t, func() {
539-
expected := []sync.Var{sync.VarVar(sync.Rec{
539+
expected := []sync.Var{sync.VarSome(sync.Rec{
540540
Nested: sync.RecNested{
541541
Foo: "foo",
542542
},
@@ -549,7 +549,7 @@ func TestIdentityListVariant(t *testing.T) {
549549
t.Run("[var(foo), empty]", func(t *testing.T) {
550550
wadge.RunTest(t, func() {
551551
expected := []sync.Var{
552-
sync.VarVar(sync.Rec{
552+
sync.VarSome(sync.Rec{
553553
Nested: sync.RecNested{
554554
Foo: "foo",
555555
},
@@ -564,19 +564,19 @@ func TestIdentityListVariant(t *testing.T) {
564564
t.Run("[var(foo), empty, var(bar), var(empty), var(baz)]", func(t *testing.T) {
565565
wadge.RunTest(t, func() {
566566
expected := []sync.Var{
567-
sync.VarVar(sync.Rec{
567+
sync.VarSome(sync.Rec{
568568
Nested: sync.RecNested{
569569
Foo: "foo",
570570
},
571571
}),
572572
sync.VarEmpty(),
573-
sync.VarVar(sync.Rec{
573+
sync.VarSome(sync.Rec{
574574
Nested: sync.RecNested{
575575
Foo: "bar",
576576
},
577577
}),
578-
sync.VarVar(sync.Rec{}),
579-
sync.VarVar(sync.Rec{
578+
sync.VarSome(sync.Rec{}),
579+
sync.VarSome(sync.Rec{
580580
Nested: sync.RecNested{
581581
Foo: "baz",
582582
},

tests/wit/sync/sync.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface sync {
1616
}
1717

1818
variant var {
19-
var(rec),
19+
some(rec),
2020
empty,
2121
}
2222

0 commit comments

Comments
 (0)