Skip to content

Commit a4438db

Browse files
committed
fix a test for 4.04
1 parent 4ad8d91 commit a4438db

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,10 @@ jobs:
3636

3737
- run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
3838

39-
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest
39+
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd
40+
if: ${{ matrix.os == 'ubuntu-latest' }}
41+
42+
- run: opam install tiny_httpd
43+
44+
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd_camlzip
4045
if: ${{ matrix.os == 'ubuntu-latest' }}

examples/dune

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@
3636
(targets vfs.ml)
3737
(deps (source_tree files) (:out test_output.txt.expected))
3838
(enabled_if (= %{system} "linux"))
39-
(action (run ../src/bin/vfs_pack.exe -o %{targets}
39+
(action (run %{bin:tiny-httpd-vfs-pack} -o %{targets}
4040
--mirror=files/
4141
--file=test_out.txt,%{out}
4242
--url=example_dot_com,http://example.com)))
4343

4444
(rule
4545
(targets vfs.ml)
4646
(enabled_if (<> %{system} "linux"))
47+
(package tiny_httpd)
4748
(action
4849
(with-stdout-to
4950
%{targets}

tests/html/makehtml.ml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
open Tiny_httpd_html
22
let spf = Printf.sprintf
33

4+
let list_init n f =
5+
let rec loop i =
6+
if i=n then []
7+
else f i :: loop (i+1)
8+
in loop 0
9+
410
let t1() =
511
html [] [
612
head [] [];
713
body [] [
814
ul [A.style "list-style: circle"] (
915
li[][pre [] [txt "a"; pre[][txt "c"; txt"d"]; txt "b"]] ::
10-
List.init 100 (fun i -> li [A.id (spf "l%d" i)] [txt (spf "item %d" i)])
16+
list_init 100 (fun i -> li [A.id (spf "l%d" i)] [txt (spf "item %d" i)])
1117
)
1218
]
1319
]
@@ -19,7 +25,7 @@ let t2() =
1925
pre [] [txt "a"; txt "b"];
2026
body [] [
2127
ul' [A.style "list-style: circle"] [
22-
sub_l @@ List.init 100 @@ fun i ->
28+
sub_l @@ list_init 100 @@ fun i ->
2329
li ~if_:(i<> 42) [A.id (spf "l%d" i)] [txt (spf "item %d" i)]
2430
]
2531
]

0 commit comments

Comments
 (0)