Skip to content

Commit 709316a

Browse files
ejgallegohhugo
authored andcommitted
[compiler] [build-fs] Test for #1694
1 parent 4204ad7 commit 709316a

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

compiler/tests-full/dune

+17
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,20 @@
2626
(= %{ocaml_version} "5.2.0"))
2727
(action
2828
(diff stdlib.cma.expected.js stdlib.cma.output.js)))
29+
30+
(rule
31+
(targets fs.output.js)
32+
(deps file1 file2)
33+
(action
34+
(run
35+
%{bin:js_of_ocaml}
36+
build-fs
37+
-o
38+
%{targets}
39+
file1:/static/file1
40+
file2:/static/dir/file2)))
41+
42+
(rule
43+
(alias runtest)
44+
(action
45+
(diff fs.expected.js fs.output.js)))

compiler/tests-full/file1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is file 1

compiler/tests-full/file2

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is file 2

compiler/tests-full/fs.expected.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(function(a){
2+
typeof globalThis !== "object"
3+
&&
4+
(this
5+
? b()
6+
: (a.defineProperty
7+
(a.prototype, "_T_", {configurable: true, get: b}),
8+
_T_));
9+
function b(){
10+
var b = this || self;
11+
b.globalThis = b;
12+
delete a.prototype._T_;
13+
}
14+
}
15+
(Object));
16+
(function(c){
17+
"use strict";
18+
function a(a, b){
19+
if(c.jsoo_create_file)
20+
c.jsoo_create_file(a, b);
21+
else{
22+
if(! c.caml_fs_tmp) c.caml_fs_tmp = [];
23+
c.caml_fs_tmp.push({name: a, content: b});
24+
}
25+
return 0;
26+
}
27+
a("/static/file1", "This is file 1");
28+
a("/static/dir/file2", "This is file 2");
29+
return;
30+
}
31+
(globalThis));

0 commit comments

Comments
 (0)