Skip to content

Commit aeabfe0

Browse files
committed
Change test to demonstrate type conversion bug
AssemblyScript#429
1 parent d434750 commit aeabfe0

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

tests/near-bindgen/main.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,11 @@ import "allocator/arena";
33
// These imports need to be copied properly
44
import { near } from "./near"
55
import { near as bazinga_near } from "./near"
6+
import { FooBar, ContainerClass, AnotherContainerClass } from "./model_near";
67

78
@external("env", "log")
89
declare function log(str: string): void;
910

10-
export class FooBar {
11-
foo: i32 = 0;
12-
bar: i32 = 1;
13-
flag: bool;
14-
baz: string = "123";
15-
//foobar: Uint8Array;
16-
arr: Array<Array<string>>;
17-
}
18-
19-
export class ContainerClass {
20-
foobar: FooBar
21-
}
22-
23-
export class AnotherContainerClass {
24-
foobar: FooBar
25-
}
26-
2711
export function doNothing(): void {
2812

2913
}

tests/near-bindgen/model.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export class FooBar {
2+
foo: i32 = 0;
3+
bar: i32 = 1;
4+
flag: bool;
5+
baz: string = "123";
6+
//foobar: Uint8Array;
7+
arr: Array<Array<string>>;
8+
}
9+
10+
export class ContainerClass {
11+
foobar: FooBar
12+
}
13+
14+
export class AnotherContainerClass {
15+
foobar: FooBar
16+
}

tests/near-bindgen/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
set -e
33
set -x
44
BASEDIR=../..
5-
$BASEDIR/bin/asc main.ts --outFile main.wat --nearFile main_near.ts
5+
$BASEDIR/bin/asc model.ts --nearFile model_near.ts
6+
$BASEDIR/bin/asc main.ts --nearFile main_near.ts
67
$BASEDIR/bin/asc main_near.ts -o main_near.wat
78
$BASEDIR/bin/asc test.ts -o test.wasm --textFile test.wat
89
prettier --parser typescript --write main_near.ts

0 commit comments

Comments
 (0)