Skip to content

Commit 2bd8e88

Browse files
committed
Added dual.html test for both pyodide and micropython
1 parent 3f10d70 commit 2bd8e88

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

test/dual.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<script type="module">
8+
import { define } from '../core.js';
9+
define('mpy', {
10+
interpreter: 'micropython',
11+
hooks: {
12+
main: {
13+
onReady(wrap, element) {
14+
wrap.run(element.textContent);
15+
}
16+
}
17+
}
18+
});
19+
define('py', {
20+
interpreter: 'pyodide',
21+
hooks: {
22+
main: {
23+
onReady(wrap, element) {
24+
wrap.run(element.textContent);
25+
}
26+
}
27+
}
28+
});
29+
</script>
30+
</head>
31+
<body>
32+
<script type="micropython">
33+
print("micropython")
34+
</script>
35+
<script type="pyodide">
36+
print("pyodide")
37+
</script>
38+
<script type="micropython" worker>
39+
print("micropython worker")
40+
</script>
41+
<script type="pyodide" worker>
42+
print("pyodide worker")
43+
</script>
44+
<script type="mpy">
45+
print("mpy")
46+
</script>
47+
<script type="py">
48+
print("py")
49+
</script>
50+
<script type="mpy" worker>
51+
print("mpy worker")
52+
</script>
53+
<script type="py" worker>
54+
print("py worker")
55+
</script>
56+
</body>
57+
</html>

test/worker-eval.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- this is the setup module script to expose long running Worker -->
99
<script type="module">
1010
// grab utilities to bootstrap a Worker out of the blue
11-
import { Hook, XWorker } from 'https://cdn.jsdelivr.net/npm/polyscript';
11+
import { Hook, XWorker } from '../core.js';
1212

1313
const runtimeURL = URL.createObjectURL(new Blob(['']));
1414

0 commit comments

Comments
 (0)