From c171ce7ad95ac6d30340c750ab33f3a2d70bd8a4 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Thu, 26 Dec 2019 14:22:13 +0100 Subject: [PATCH] fully tested md_files --- src/test/dune | 2 +- src/test/md_file_tests.ml | 36 +++++++----------------------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/test/dune b/src/test/dune index 9c018595d..9582317c9 100644 --- a/src/test/dune +++ b/src/test/dune @@ -17,7 +17,7 @@ (alias (name doc-test) (action (run ./doc_test.exe)) - (deps (source_tree ../../gitlab-pages/docs/language-basics)) + (deps (source_tree ../../gitlab-pages/docs)) ) (alias diff --git a/src/test/md_file_tests.ml b/src/test/md_file_tests.ml index 02336dcfe..c2e275a3d 100644 --- a/src/test/md_file_tests.ml +++ b/src/test/md_file_tests.ml @@ -5,11 +5,8 @@ module SnippetsGroup = Map.Make(struct type t = (string * string) let compare a let failed_to_compile_md_file md_file (s,group,prg) = let title () = "Failed to compile ```"^s^" block (group '"^group^"') in file '"^md_file^"'" in - let content () = "unable to compile the program down to michelson" in - let data = [ - ("source" , fun () -> Format.asprintf "%s" prg) ; - ] in - error ~data title content + let content () = "\n"^prg in + error title content (** binds the snippets by (syntax, group_name) @@ -34,6 +31,7 @@ let get_groups md_file = | None -> Some (String.concat "\n" el.contents) ) grp_map + | [Md.Field "skip"] -> grp_map | _ -> List.fold_left (fun grp_map arg -> match arg with @@ -57,8 +55,8 @@ let get_groups md_file = **) let compile_groups _filename grp_list = let%bind (_michelsons : Compiler.compiled_expression list list) = bind_map_list - (fun ((s,_grp),contents) -> - trace (failed_to_compile_md_file _filename (s,_grp,contents)) @@ + (fun ((s,grp),contents) -> + trace (failed_to_compile_md_file _filename (s,grp,contents)) @@ let%bind v_syntax = Compile.Helpers.syntax_to_variant (Syntax_name s) None in let%bind simplified = Compile.Of_source.compile_string contents v_syntax in let%bind typed,_ = Compile.Of_simplified.compile simplified in @@ -79,24 +77,19 @@ let compile filename () = find ./gitlab-pages/ -iname "*.md" *) let md_files = [ - (* "/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-smart-contract.md"; "/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md"; "/gitlab-pages/docs/intro/installation.md"; "/gitlab-pages/docs/intro/editor-support.md"; "/gitlab-pages/docs/intro/what-and-why.md"; - "/gitlab-pages/docs/language-basics/functions.md"; "/gitlab-pages/docs/language-basics/math-numbers-tez.md"; - *) - (* antislash problem: - "/gitlab-pages/docs/language-basics/strings.md"; + "/gitlab-pages/docs/language-basics/functions.md"; "/gitlab-pages/docs/language-basics/boolean-if-else.md"; "/gitlab-pages/docs/language-basics/types.md"; - *) + "/gitlab-pages/docs/language-basics/strings.md"; "/gitlab-pages/docs/language-basics/maps-records.md"; "/gitlab-pages/docs/language-basics/variables-and-constants.md"; "/gitlab-pages/docs/language-basics/sets-lists-touples.md"; - (* "/gitlab-pages/docs/language-basics/operators.md"; "/gitlab-pages/docs/language-basics/unit-option-pattern-matching.md"; "/gitlab-pages/docs/contributors/big-picture/back-end.md"; @@ -116,21 +109,6 @@ let md_files = [ "/gitlab-pages/docs/advanced/timestamps-addresses.md"; "/gitlab-pages/docs/api/cli-commands.md"; "/gitlab-pages/docs/api/cheat-sheet.md"; - "/gitlab-pages/website/blog/2019-07-11-ligo-update.md"; - "/gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/back-end.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/vendors.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/front-end.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/overview.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/big-picture/middle-end.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/philosophy.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/road-map/short-term.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/road-map/long-term.md"; - "/gitlab-pages/website/versioned_docs/version-next/contributors/origin.md"; - "/gitlab-pages/website/versioned_docs/version-next/api-cli-commands.md"; - "/gitlab-pages/website/README.md"; - "/gitlab-pages/README.md"; - *) ] let md_root = "../../gitlab-pages/docs/language-basics/"