Skip to content

Commit 3ffc862

Browse files
committed
repro large variant timeout
for #8039
1 parent 3027d26 commit 3ffc862

File tree

8 files changed

+137
-0
lines changed

8 files changed

+137
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SHELL = /bin/bash
2+
3+
build:
4+
yarn build
5+
6+
clean:
7+
yarn clean
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "perf_test",
3+
"private": true,
4+
"scripts": {
5+
"build": "rescript-legacy build",
6+
"clean": "rescript-legacy clean"
7+
},
8+
"dependencies": {
9+
"rescript": "workspace:^"
10+
}
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "test",
3+
"sources": [
4+
{
5+
"dir": "src",
6+
"subdirs": true
7+
}
8+
],
9+
"suffix": ".res.js"
10+
}

tests/analysis_tests/perf_test/src/Player.js

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@unboxed
2+
type key =
3+
// | @as("f2") F2
4+
// | @as("f3") F3
5+
// | @as("f4") F4
6+
// | @as("f5") F5
7+
// | @as("f6") F6
8+
// | @as("f7") F7
9+
// | @as("f8") F8
10+
// | @as("f9") F9
11+
| @as("f10") F10
12+
| @as("l") L
13+
| @as("m") M
14+
| @as("n") N
15+
| @as("o") O
16+
| @as("p") P
17+
| @as("q") Q
18+
| @as("r") R
19+
| @as("s") S
20+
| @as("t") T
21+
| @as("u") U
22+
| @as("v") V
23+
| @as("w") W
24+
| @as("x") X
25+
| @as("space") Space
26+
| @as("left") Left
27+
| @as("right") Right
28+
| @as("up") Up
29+
| @as("down") Down
30+
| @as("escape") Escape
31+
| @as("backspace") Backspace
32+
| @as("enter") Enter
33+
| @as("tab") Tab
34+
| @as("control") Control
35+
| @as("alt") Alt
36+
| @as("meta") Meta
37+
| @as("shift") Shift
38+
| @as("string") String(string)
39+
40+
@send
41+
external onKeyRelease: (key => unit) => unit = "onKeyRelease"
42+
43+
let make = () => {
44+
let gameObj: Thundershock.t = Obj.magic(3)
45+
46+
onKeyRelease(key => {
47+
let isYAxis = !(gameObj.direction.y == 0.)
48+
switch key {
49+
| Space =>
50+
if isYAxis {
51+
Thundershock.cast(gameObj)->ignore
52+
}
53+
| _ => ()
54+
}
55+
})
56+
57+
gameObj
58+
}

tests/analysis_tests/perf_test/src/Thundershock.js

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
type team = Player | Opponent
2+
3+
type vec2 = {
4+
mutable x: float,
5+
mutable y: float,
6+
}
7+
8+
9+
type t = {mutable direction: vec2}
10+
11+
12+
let cast = (_: t) => {
13+
()
14+
}
15+

yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,6 +2415,14 @@ __metadata:
24152415
languageName: node
24162416
linkType: hard
24172417

2418+
"perf_test@workspace:tests/analysis_tests/perf_test":
2419+
version: 0.0.0-use.local
2420+
resolution: "perf_test@workspace:tests/analysis_tests/perf_test"
2421+
dependencies:
2422+
rescript: "workspace:^"
2423+
languageName: unknown
2424+
linkType: soft
2425+
24182426
"picocolors@npm:^1.0.0, picocolors@npm:^1.1.1":
24192427
version: 1.1.1
24202428
resolution: "picocolors@npm:1.1.1"

0 commit comments

Comments
 (0)