Sha256: 432e876006de3a45f6c1b125a046a61a711735cb08732ffd3042a596969088ae

Contents?: true

Size: 1.68 KB

Versions: 38

Compression:

Stored size: 1.68 KB

Contents

;; type names don't matter
(witx $a
  (typename $a (flags (@witx repr u8) $b $c)))
(witx $b
  (typename $b (flags (@witx repr u8) $b $c)))

(assert_representable eq $a "a" $b "b")
(assert_representable eq $b "b" $a "a")

(; TODO: perhaps add assertions eventually for document-level representability?
;; flags
(witx $a
  (typename $a (flags (@witx bitflags u8) $b $c)))
(witx $b
  (typename $b (flags (@witx bitflags u8) $b $c $d)))

(assert_representable noteq $b "b" $a "a")
(assert_representable superset $a "a" $b "b")

(witx $c
  (typename $c (flags (@witx bitflags u8) $b $e)))
(assert_representable noteq $a "a" $c "c")
(assert_representable noteq $c "c" $a "a")

(witx $d
  (typename $d (flags (@witx bitflags u16) $b $c)))
(assert_representable noteq $a "a" $d "d")
(assert_representable superset $d "d" $a "a")
(assert_representable superset $d "d" $b "b")
;)

;; enums
(witx $a
  (typename $a (enum $b $c)))
(witx $b
  (typename $b (enum $b $c $d)))
(assert_representable superset $a "a" $b "b")
(assert_representable noteq $b "b" $a "a")

(witx $c
  (typename $c (enum (@witx tag u16) $b $c)))
(assert_representable superset $c "c" $a "a")
(assert_representable superset $c "c" $b "b")

;; unions
(witx $a
  (typename $tag (enum $b $c))
  (typename $a (union (@witx tag $tag) u32 f32)))
(witx $b
  (typename $tag (enum $b $c $d))
  (typename $b (union (@witx tag $tag) u32 f32 f64)))
(assert_representable superset $a "a" $b "b")
(assert_representable noteq $b "b" $a "a")

(witx $c
  (typename $tag (enum $b $c))
  (typename $c (variant (@witx tag $tag) (case $c f32) (case $b u32))))
(assert_representable eq $a "a" $c "c")
(assert_representable eq $c "c" $a "a")
(assert_representable superset $c "c" $b "b")

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-28.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-27.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-26.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-25.0.2 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-25.0.1 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-25.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-24.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-23.0.2 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-22.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-21.0.1 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-20.0.2 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-20.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-18.0.3 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-17.0.1 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-17.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-16.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-15.0.1 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-15.0.0 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt
wasmtime-14.0.4 ./ext/cargo-vendor/witx-0.9.1/tests/witxt/representation.witxt