Stops using "ex." to abbreviate "for example" (#827)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -18,7 +18,7 @@ func TestEncodeCode(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "smallest function body",
|
||||
input: &wasm.Code{ // Ex. (func)
|
||||
input: &wasm.Code{ // e.g. (func)
|
||||
Body: []byte{wasm.OpcodeEnd},
|
||||
},
|
||||
expected: []byte{
|
||||
@@ -29,7 +29,7 @@ func TestEncodeCode(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "params and instructions", // local.get index space is params, then locals
|
||||
input: &wasm.Code{ // Ex. (func (type 3) local.get 0 local.get 1 i32.add)
|
||||
input: &wasm.Code{ // e.g. (func (type 3) local.get 0 local.get 1 i32.add)
|
||||
Body: addLocalZeroLocalOne,
|
||||
},
|
||||
expected: append([]byte{
|
||||
@@ -41,7 +41,7 @@ func TestEncodeCode(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "locals and instructions",
|
||||
input: &wasm.Code{ // Ex. (func (result i32) (local i32, i32) local.get 0 local.get 1 i32.add)
|
||||
input: &wasm.Code{ // e.g. (func (result i32) (local i32, i32) local.get 0 local.get 1 i32.add)
|
||||
LocalTypes: []wasm.ValueType{wasm.ValueTypeI32, wasm.ValueTypeI32},
|
||||
Body: addLocalZeroLocalOne,
|
||||
},
|
||||
@@ -55,7 +55,7 @@ func TestEncodeCode(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "mixed locals and instructions",
|
||||
input: &wasm.Code{ // Ex. (func (result i32) (local i32) (local i64) (local i32) local.get 0 local.get 2 i32.add)
|
||||
input: &wasm.Code{ // e.g. (func (result i32) (local i32) (local i64) (local i32) local.get 0 local.get 2 i32.add)
|
||||
LocalTypes: []wasm.ValueType{wasm.ValueTypeI32, wasm.ValueTypeI64, wasm.ValueTypeI32},
|
||||
Body: addLocalZeroLocalTwo,
|
||||
},
|
||||
@@ -82,7 +82,7 @@ func TestEncodeCode(t *testing.T) {
|
||||
}
|
||||
|
||||
func BenchmarkEncodeCode(b *testing.B) {
|
||||
input := &wasm.Code{ // Ex. (func (result i32) (local i32) (local i64) (local i32) local.get 0 local.get 2 i32.add)
|
||||
input := &wasm.Code{ // e.g. (func (result i32) (local i32) (local i64) (local i32) local.get 0 local.get 2 i32.add)
|
||||
LocalTypes: []wasm.ValueType{wasm.ValueTypeI32, wasm.ValueTypeI64, wasm.ValueTypeI32},
|
||||
Body: addLocalZeroLocalTwo,
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "func no name, index 0",
|
||||
input: &wasm.Export{ // Ex. (export "" (func 0)))
|
||||
input: &wasm.Export{ // e.g. (export "" (func 0)))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Name: "",
|
||||
Index: 0,
|
||||
@@ -24,7 +24,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "func name, func index 0",
|
||||
input: &wasm.Export{ // Ex. (export "pi" (func 0))
|
||||
input: &wasm.Export{ // e.g. (export "pi" (func 0))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Name: "pi",
|
||||
Index: 0,
|
||||
@@ -37,7 +37,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "func name, index 10",
|
||||
input: &wasm.Export{ // Ex. (export "pi" (func 10))
|
||||
input: &wasm.Export{ // e.g. (export "pi" (func 10))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Name: "pi",
|
||||
Index: 10,
|
||||
@@ -50,7 +50,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "global no name, index 0",
|
||||
input: &wasm.Export{ // Ex. (export "" (global 0)))
|
||||
input: &wasm.Export{ // e.g. (export "" (global 0)))
|
||||
Type: wasm.ExternTypeGlobal,
|
||||
Name: "",
|
||||
Index: 0,
|
||||
@@ -59,7 +59,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "global name, global index 0",
|
||||
input: &wasm.Export{ // Ex. (export "pi" (global 0))
|
||||
input: &wasm.Export{ // e.g. (export "pi" (global 0))
|
||||
Type: wasm.ExternTypeGlobal,
|
||||
Name: "pi",
|
||||
Index: 0,
|
||||
@@ -72,7 +72,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "global name, index 10",
|
||||
input: &wasm.Export{ // Ex. (export "pi" (global 10))
|
||||
input: &wasm.Export{ // e.g. (export "pi" (global 10))
|
||||
Type: wasm.ExternTypeGlobal,
|
||||
Name: "pi",
|
||||
Index: 10,
|
||||
@@ -85,7 +85,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "memory no name, index 0",
|
||||
input: &wasm.Export{ // Ex. (export "" (memory 0)))
|
||||
input: &wasm.Export{ // e.g. (export "" (memory 0)))
|
||||
Type: wasm.ExternTypeMemory,
|
||||
Name: "",
|
||||
Index: 0,
|
||||
@@ -94,7 +94,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "memory name, memory index 0",
|
||||
input: &wasm.Export{ // Ex. (export "mem" (memory 0))
|
||||
input: &wasm.Export{ // e.g. (export "mem" (memory 0))
|
||||
Type: wasm.ExternTypeMemory,
|
||||
Name: "mem",
|
||||
Index: 0,
|
||||
@@ -107,7 +107,7 @@ func TestEncodeExport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "memory name, index 10",
|
||||
input: &wasm.Export{ // Ex. (export "mem" (memory 10))
|
||||
input: &wasm.Export{ // e.g. (export "mem" (memory 10))
|
||||
Type: wasm.ExternTypeMemory,
|
||||
Name: "mem",
|
||||
Index: 10,
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestEncodeImport(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "func no module, no name, type index 0",
|
||||
input: &wasm.Import{ // Ex. (import "" "" (func (type 0)))
|
||||
input: &wasm.Import{ // e.g. (import "" "" (func (type 0)))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Module: "",
|
||||
Name: "",
|
||||
@@ -29,7 +29,7 @@ func TestEncodeImport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "func module, no name, type index 0",
|
||||
input: &wasm.Import{ // Ex. (import "$test" "" (func (type 0)))
|
||||
input: &wasm.Import{ // e.g. (import "$test" "" (func (type 0)))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Module: "test",
|
||||
Name: "",
|
||||
@@ -44,7 +44,7 @@ func TestEncodeImport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "func module, name, type index 0",
|
||||
input: &wasm.Import{ // Ex. (import "$math" "$pi" (func (type 0)))
|
||||
input: &wasm.Import{ // e.g. (import "$math" "$pi" (func (type 0)))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Module: "math",
|
||||
Name: "pi",
|
||||
@@ -59,7 +59,7 @@ func TestEncodeImport(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "func module, name, type index 10",
|
||||
input: &wasm.Import{ // Ex. (import "$math" "$pi" (func (type 10)))
|
||||
input: &wasm.Import{ // e.g. (import "$math" "$pi" (func (type 10)))
|
||||
Type: wasm.ExternTypeFunc,
|
||||
Module: "math",
|
||||
Name: "pi",
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestEncodeNameSectionData(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "only module",
|
||||
// Ex. (module $simple )
|
||||
// e.g. (module $simple )
|
||||
input: &wasm.NameSection{ModuleName: "simple"},
|
||||
expected: []byte{
|
||||
subsectionIDModuleName, 0x07, // 7 bytes
|
||||
@@ -50,7 +50,7 @@ func TestEncodeNameSectionData(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "two function names", // Ex. TinyGo which at one point didn't set a module name
|
||||
name: "two function names", // e.g. TinyGo which at one point didn't set a module name
|
||||
// (module
|
||||
// (import "wasi_snapshot_preview1" "args_sizes_get" (func $wasi.args_sizes_get (param i32, i32) (result i32)))
|
||||
// (import "wasi_snapshot_preview1" "fd_write" (func $wasi.fd_write (param i32, i32, i32, i32) (result i32)))
|
||||
|
||||
Reference in New Issue
Block a user