Skip to content

Commit

Permalink
Fix dune tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg committed Dec 7, 2023
1 parent a9f2dfc commit 0ae7c56
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 7 deletions.
136 changes: 136 additions & 0 deletions spectec/test-frontend/TEST.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,139 @@
# Test

```sh
$ (dune exec ../src/exe-watsup/main.exe -- test.watsup -o test.tex && cat test.tex)
$$
\begin{array}{@{}lrrl@{}l@{}}
& {\mathit{testmixfix}} &::=& \{{{\mathit{nat}}^\ast}\} ~|~ [{{\mathit{nat}}^\ast}] ~|~ {\mathit{nat}} \rightarrow {\mathit{nat}} \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testmixfix}}(\{{{\mathit{nat}}^\ast}\}) &=& {{\mathit{nat}}^\ast} & \\
{\mathrm{testmixfix}}([{{\mathit{nat}}^\ast}]) &=& {{\mathit{nat}}^\ast} & \\
{\mathrm{testmixfix}}({\mathit{nat}}_{{1}} \rightarrow {\mathit{nat}}_{{2}}) &=& {\mathit{nat}}_{{1}}~{\mathit{nat}}_{{2}} & \\
\end{array}
$$

\vspace{1ex}

$$
\begin{array}{@{}lrrl@{}l@{}}
& {\mathit{opt}} &::=& {\mathsf{o}^?} \\
& {\mathit{list}} &::=& {\mathsf{l}^\ast} \\
& {\mathit{variant}} &::=& \mathsf{v{\scriptstyle1}}~{\mathit{opt}}~{\mathit{nat}} \\ &&|&
\mathsf{v{\scriptstyle2}}~{\mathsf{o}^?}~{\mathit{nat}} \\ &&|&
\mathsf{v{\scriptstyle3}}~{{\mathit{text}}^?}~{\mathit{nat}} \\ &&|&
\mathsf{v{\scriptstyle4}}~{\mathit{list}}~{\mathit{nat}} \\ &&|&
\mathsf{v{\scriptstyle5}}~{\mathsf{l}^\ast}~{\mathit{nat}} \\ &&|&
\mathsf{v{\scriptstyle6}}~{{\mathit{text}}^\ast}~{\mathit{nat}} \\
& {\mathit{notation{\scriptstyle1}}} &::=& {\mathit{opt}}~{\mathit{nat}} \\
& {\mathit{notation{\scriptstyle2}}} &::=& {\mathsf{o}^?}~{\mathit{nat}} \\
& {\mathit{notation{\scriptstyle3}}} &::=& {{\mathit{text}}^?}~{\mathit{nat}} \\
& {\mathit{notation{\scriptstyle4}}} &::=& {\mathit{list}}~{\mathit{nat}} \\
& {\mathit{notation{\scriptstyle5}}} &::=& {\mathsf{l}^\ast}~{\mathit{nat}} \\
& {\mathit{notation{\scriptstyle6}}} &::=& {{\mathit{text}}^\ast}~{\mathit{nat}} \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyv{\scriptstyle1}}}(\mathsf{v{\scriptstyle1}}~{\mathit{opt}}~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle1}}}(\mathsf{v{\scriptstyle1}}~\epsilon~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle1}}}(\mathsf{v{\scriptstyle1}}~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle1}}}(\mathsf{v{\scriptstyle1}}~\mathsf{o}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyv{\scriptstyle2}}}(\mathsf{v{\scriptstyle2}}~\epsilon~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle2}}}(\mathsf{v{\scriptstyle2}}~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle2}}}(\mathsf{v{\scriptstyle2}}~\mathsf{o}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyv{\scriptstyle3}}}(\mathsf{v{\scriptstyle3}}~\epsilon~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle3}}}(\mathsf{v{\scriptstyle3}}~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle3}}}(\mathsf{v{\scriptstyle3}}~``''~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyv{\scriptstyle4}}}(\mathsf{v{\scriptstyle4}}~{\mathit{list}}~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle4}}}(\mathsf{v{\scriptstyle4}}~\epsilon~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle4}}}(\mathsf{v{\scriptstyle4}}~\mathsf{l}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyv{\scriptstyle5}}}(\mathsf{v{\scriptstyle5}}~\epsilon~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle5}}}(\mathsf{v{\scriptstyle5}}~\mathsf{l}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyv{\scriptstyle6}}}(\mathsf{v{\scriptstyle6}}~\epsilon~0) &=& 0 & \\
{\mathrm{testemptyv{\scriptstyle6}}}(\mathsf{v{\scriptstyle6}}~``''~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyn{\scriptstyle1}}}({\mathit{opt}}~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle1}}}(\epsilon~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle1}}}(0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle1}}}(\mathsf{o}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyn{\scriptstyle2}}}(\epsilon~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle2}}}(0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle2}}}(\mathsf{o}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyn{\scriptstyle3}}}(\epsilon~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle3}}}(0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle3}}}(``''~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyn{\scriptstyle4}}}({\mathit{list}}~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle4}}}(\epsilon~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle4}}}(\mathsf{l}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyn{\scriptstyle5}}}(\epsilon~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle5}}}(\mathsf{l}~0) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{testemptyn{\scriptstyle6}}}(\epsilon~0) &=& 0 & \\
{\mathrm{testemptyn{\scriptstyle6}}}(``''~0) &=& 0 & \\
\end{array}
$$

```


# Preview

```sh
Expand Down
1 change: 1 addition & 0 deletions spectec/test-frontend/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(deps
(file ../src/exe-watsup/main.exe)
(glob_files_rec ../spec/*)
(file test.watsup)
)
(files TEST.md)
)
33 changes: 26 additions & 7 deletions spectec/test-latex/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,32 @@

```sh
$ (dune exec ../src/exe-watsup/main.exe -- test.watsup -o test.tex && cat test.tex)
/Users/me/Desktop/Work/Software/wasm/spec.tec/spectec/_build/default/test-latex/../src/exe-watsup/main.exe: uncaught exception Sys_error("test.watsup: No such file or directory")
Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 405, characters 28-54
Called from Stdlib.open_in in file "stdlib.ml" (inlined), line 410, characters 2-45
Called from Frontend__Parse.parse_file in file "src/frontend/parse.ml", line 20, characters 11-23
Called from Stdlib__List.concat_map.aux in file "list.ml", line 268, characters 16-19
Called from Dune__exe__Main in file "src/exe-watsup/main.ml", line 132, characters 13-60
[2]
$$
\begin{array}{@{}lcl@{}l@{}}
{\mathrm{test}}_{{\mathit{sub}}_{{\mathsf{atom}}_{{22}}}}({\mathit{n}}_{{3}_{{\mathsf{atom}}_{{\mathit{y}}}}}) &=& 0 & \\
\end{array}
$$

$$
\begin{array}{@{}lcl@{}l@{}}
{{\mathrm{curried}}}_{{\mathit{n}}_{{1}}}({\mathit{n}}_{{2}}) &=& {\mathit{n}}_{{1}} + {\mathit{n}}_{{2}} & \\
\end{array}
$$

$$
\begin{array}{@{}lrrl@{}l@{}}
& {\mathit{testfuse}} &::=& {\mathsf{ab}}_{{\mathit{nat}}}\,{\mathit{nat}}~{\mathit{nat}} \\ &&|&
{\mathsf{cd}}_{{\mathit{nat}}}\,{\mathit{nat}}~{\mathit{nat}} \\ &&|&
{\mathsf{ef\_}}{{\mathit{nat}}}~{\mathit{nat}}~{\mathit{nat}} \\ &&|&
{{\mathsf{gh}}_{{\mathit{nat}}}}{{\mathit{nat}}}~{\mathit{nat}} \\ &&|&
{{\mathsf{ij}}_{{\mathit{nat}}}}{{\mathit{nat}}}~{\mathit{nat}} \\ &&|&
{\mathsf{kl\_ab}}{{\mathit{nat}}}~{\mathit{nat}}~{\mathit{nat}} \\ &&|&
{\mathsf{mn\_}}{\mathsf{ab}}~{\mathit{nat}}~{\mathit{nat}}~{\mathit{nat}} \\ &&|&
{{\mathsf{op\_}}{\mathsf{ab}}}{{\mathit{nat}}}~{\mathit{nat}}~{\mathit{nat}} \\ &&|&
{{\mathsf{qr}}_{{\mathit{nat}}}}{\mathsf{ab}}~{\mathit{nat}}~{\mathit{nat}} \\
\end{array}
$$

```


Expand Down
1 change: 1 addition & 0 deletions spectec/test-latex/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(file ../src/exe-watsup/main.exe)
(glob_files_rec ../spec/*)
(file spec-splice.in.tex)
(file test.watsup)
)
(files TEST.md)
)

0 comments on commit 0ae7c56

Please sign in to comment.