Skip to content

Commit 5ab43f5

Browse files
committed
Medias: improve test
1 parent e5cd182 commit 5ab43f5

File tree

2 files changed

+48
-32
lines changed

2 files changed

+48
-32
lines changed

test/pages/medias.t/index.mld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ Some image:
1818

1919
{1 Audio}
2020

21+
{2 References}
22+
23+
{audio!Cri_du_chameau.ogg}
24+
2125
{2 Links}
2226

2327
{audio:https://upload.wikimedia.org/wikipedia/commons/f/f1/Cri_du_chameau.ogg}
2428

2529
{1 Video}
2630

31+
{2 References}
32+
33+
{video:flower.webm}
34+
2735
{2 Links}
2836

2937
{video:https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm}

test/pages/medias.t/run.t

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ We need to odoc-compile the package mld file, listing its children
33
$ odoc compile index.mld --parent-id pkg1/doc/ --output-dir _odoc
44

55
$ odoc compile-asset --parent-id pkg1/doc/ --output-dir _odoc --name caml.gif
6+
$ odoc compile-asset --parent-id pkg1/doc/ --output-dir _odoc --name Cri_du_chameau.ogg
7+
$ odoc compile-asset --parent-id pkg1/doc/ --output-dir _odoc --name flower.webm
68

79
This will have produced a file called 'page-index.odoc'.
810

911
Link (and generate the HTML):
1012
$ odoc link -P pkg1:_odoc/pkg1/doc _odoc/pkg1/doc/page-index.odoc
11-
File "index.mld", line 33, characters 48-64:
13+
File "index.mld", line 41, characters 48-64:
1214
Warning: Failed to resolve reference ./module-x Path 'module-x' not found
1315
File "index.mld", line 12, characters 28-83:
1416
Warning: Failed to resolve reference ./camezfzeffl.gif Path 'camezfzeffl.gif' not found
@@ -23,43 +25,49 @@ To test visually, indent:
2325

2426
Testing the working references:
2527

26-
$ cat html/index/index.html | grep img
27-
cat: html/index/index.html: No such file or directory
28-
[1]
28+
$ cat html/pkg1/doc/index.html | grep img
29+
<a href="caml.gif" class="img-link">
30+
<img src="caml.gif" alt="caml.gif"/>
31+
<a href="caml.gif" class="img-link">
32+
<img src="caml.gif" alt="With alt text and emphasis"/>
33+
<a href="https://picsum.photos/200/300" class="img-link">
34+
<img src="https://picsum.photos/200/300" alt="reference"/>
35+
<a href="https://picsum.photos/200/300" class="img-link">
36+
<img src="https://picsum.photos/200/300"
2937

30-
$ cat html/index/index.html | grep video
31-
cat: html/index/index.html: No such file or directory
32-
[1]
38+
$ cat html/pkg1/doc/index.html | grep video
39+
<li><a href="#video">Video</a>
40+
</div><h2 id="video"><a href="#video" class="anchor"></a>Video</h2>
41+
</h3><div><video src="flower.webm" controls="controls"></video></div>
42+
<video
43+
src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
44+
</video>
3345

34-
$ cat html/index/index.html | grep audio
35-
cat: html/index/index.html: No such file or directory
36-
[1]
46+
$ cat html/pkg1/doc/index.html | grep audio
47+
<li><a href="#audio">Audio</a>
48+
</ul><h2 id="audio"><a href="#audio" class="anchor"></a>Audio</h2>
49+
<div><audio src="Cri_du_chameau.ogg" controls="controls"></audio></div>
50+
<audio
51+
</audio>
3752

3853
Testing the unresolved references:
3954

40-
$ cat html/index/index.html | grep xref-unresolved
41-
cat: html/index/index.html: No such file or directory
42-
[1]
55+
$ cat html/pkg1/doc/index.html | grep xref-unresolved
56+
<div><span class="xref-unresolved"><code>./caqzdqzdml.gif</code></span>
57+
<span class="xref-unresolved">With alt text and <b>emphasis</b></span>
58+
<div><span class="xref-unresolved"><code>./module-x</code></span></div>
4359

4460
Testing latex and manpages
4561

46-
$ odoc latex-generate -o latex page-index.odocl
47-
odoc: FILE.odocl argument: no 'page-index.odocl' file or directory
48-
Usage: odoc latex-generate [OPTION]… FILE.odocl
49-
Try 'odoc latex-generate --help' or 'odoc --help' for more information.
50-
[2]
51-
$ cat latex/index.tex | grep ocamlinlinecode
52-
cat: latex/index.tex: No such file or directory
53-
[1]
62+
$ odoc latex-generate -o latex _odoc/pkg1/doc/page-index.odocl
63+
$ cat latex/pkg1/doc/index.tex | grep gif
64+
\ocamlinlinecode{caml.\allowbreak{}gif}
65+
\ocamlinlinecode{.\allowbreak{}/caqzdqzdml.\allowbreak{}gif}
5466

55-
$ odoc man-generate -o man page-index.odocl
56-
odoc: FILE.odocl argument: no 'page-index.odocl' file or directory
57-
Usage: odoc man-generate [OPTION]… FILE.odocl
58-
Try 'odoc man-generate --help' or 'odoc --help' for more information.
59-
[2]
60-
$ cat man/index.3o | grep gif
61-
cat: man/index.3o: No such file or directory
62-
[1]
63-
$ cat man/index.3o | grep "With alt text"
64-
cat: man/index.3o: No such file or directory
65-
[1]
67+
$ odoc man-generate -o man _odoc/pkg1/doc/page-index.odocl
68+
$ cat man/pkg1/doc/index.3o | grep gif
69+
caml\.gif
70+
\./caqzdqzdml\.gif
71+
$ cat man/pkg1/doc/index.3o | grep "With alt text"
72+
With alt text and \fBemphasis\fR
73+
With alt text and \fBemphasis\fR

0 commit comments

Comments
 (0)