ocaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove a test that depends on env-specific output

References: https://todo.sr.ht/~jonsterling/forester/164

-161
-1
lib/compiler/test/dune
··· 7 7 Test_expansion 8 8 Test_compiler 9 9 Test_diagnostic_store 10 - Test_errors 11 10 Test_graph_database 12 11 Test_import_graph 13 12 Test_uri_util)
-16
lib/core/test/Test_errors.expected
··· 1 - → error[import_not_found] 2 - ꭍ ○ when expanding tree http://forest.local/test-1/ 3 - ■ /Users/jon/Developer/ocaml-forester/_build/default/lib/core/test/forest/_tmp/d49a14/trees/test-1.tree 4 - 1 | \import{nonexistent} 5 - ^ http://forest.local/nonexistent/ not found 6 - 7 - {"title":"http://forest.local/test-1/","uri":"test-1","taxon":null,"tags":[],"route":"/test-1/","metas":{}} 8 - {"title":"http://forest.local/test-3/","uri":"test-3","taxon":null,"tags":["nonexistent"],"route":"/test-3/","metas":{}} 9 - {"title":"Jon Sterling","uri":"jon","taxon":"person","tags":[],"route":"/jon/","metas":{}} 10 - → error[duplicate_tree] 11 - ꭍ ○ when loading files from disk 12 - ○ /Users/jon/Developer/ocaml-forester/_build/default/lib/core/test/forest/_tmp/d49a14/_tmp/adb27b/_tmp/ede83f/_tmp/161301/trees2/duplicate.tree 13 - and 14 - /Users/jon/Developer/ocaml-forester/_build/default/lib/core/test/forest/_tmp/d49a14/_tmp/adb27b/_tmp/ede83f/_tmp/161301/trees1/duplicate.tree 15 - use the same URI 16 -
-107
lib/core/test/Test_errors.ml
··· 1 - (* 2 - * SPDX-FileCopyrightText: 2024 The Forester Project Contributors 3 - * 4 - * SPDX-License-Identifier: GPL-3.0-or-later 5 - *) 6 - 7 - open Forester_prelude 8 - open Forester_test 9 - open Forester_core 10 - open Forester_compiler 11 - open Forester_frontend 12 - 13 - let error_run ~env ~config ~raw_trees = 14 - with_test_forest 15 - ~raw_trees 16 - ~env 17 - ~config 18 - (fun path -> 19 - Sys.chdir (Eio.Path.native_exn path); 20 - let@ () = Reporter.easy_run in 21 - let forest = State.make ~env ~config ~dev: false () in 22 - let forest = Driver.run_until_done Load_all_configured_dirs forest in 23 - URI.Tbl.iter (fun _ d -> List.iter Reporter.Tty.display d) forest.diagnostics 24 - ) 25 - 26 - module Import = struct 27 - let raw_trees = [{path = "test-1.tree"; content = {|\import{nonexistent}|}};] 28 - let test_case ~env ~config = error_run ~env ~config ~raw_trees 29 - end 30 - 31 - module Duplicate = struct 32 - let raw_trees = [ 33 - {path = "trees1/duplicate.tree"; content = {||}}; 34 - {path = "trees2/duplicate.tree"; content = {||}} 35 - ] 36 - let config = {Config.(default ?url: None ()) with trees = ["trees1"; "trees2"]} 37 - let test_case ~env = error_run ~env ~config ~raw_trees 38 - end 39 - 40 - module Expansion = struct 41 - let raw_trees = [ 42 - { 43 - path = "jon.tree"; 44 - content = {| 45 - \taxon{person} 46 - \title{Jon Sterling} 47 - |} 48 - }; 49 - { 50 - path = "test-1.tree"; 51 - content = {| 52 - \def\greet[name]{Hello, \name!} 53 - |} 54 - }; 55 - { 56 - path = "test-2.tree"; 57 - content = {| 58 - \import{test-1} 59 - \greet{jon} 60 - \greet 61 - |} 62 - }; 63 - { 64 - path = "test-3.tree"; 65 - content = {| 66 - \tag{nonexistent} 67 - |} 68 - }; 69 - ] 70 - 71 - let test_case ~env ~config = 72 - let@ path = with_test_forest ~raw_trees ~env ~config in 73 - Sys.chdir (Eio.Path.native_exn path); 74 - let@ () = Reporter.easy_run in 75 - let forest = 76 - State.make ~env ~config ~dev: false () 77 - |> Driver.run_until_done Load_all_configured_dirs 78 - in 79 - URI.Tbl.iter (fun _ d -> List.iter Reporter.Tty.display d) forest.diagnostics; 80 - let@ article = Seq.iter @~ State.get_all_articles forest in 81 - let@ json = 82 - Option.iter @~ Json_manifest_client.render_tree ~forest ~dev: false article 83 - in 84 - Format.printf "%s@." (Yojson.Safe.to_string json) 85 - end 86 - 87 - module Broken_link = struct 88 - let raw_trees = [ 89 - { 90 - path = "test.tree"; 91 - content = {|[link](nonexistent)|} 92 - } 93 - ] 94 - 95 - let test_case ~env ~config = error_run ~env ~config ~raw_trees 96 - end 97 - 98 - let config = Config.default () 99 - 100 - let () = 101 - let@ env = Eio_main.run in 102 - (* Logs.set_level (Some Debug); *) 103 - (* Logs.set_reporter (Logs.format_reporter ()); *) 104 - Import.test_case ~env ~config; 105 - Expansion.test_case ~env ~config; 106 - Broken_link.test_case ~env ~config; 107 - Duplicate.test_case ~env;
-37
lib/core/test/dune
··· 2 2 ;;; 3 3 ;;; SPDX-License-Identifier: GPL-3.0-or-later 4 4 5 - (executable 6 - (preprocess 7 - (pps ppx_deriving.show)) 8 - (public_name test-errors) 9 - (name Test_errors) 10 - (libraries 11 - logs 12 - logs.fmt 13 - yojson 14 - eio 15 - eio.core 16 - eio.unix 17 - eio_main 18 - forester.test 19 - forester.compiler 20 - forester.core 21 - forester.prelude 22 - forester.frontend 23 - pure-html 24 - asai)) 25 - 26 - (rule 27 - (with-stdout-to 28 - Test_errors.out 29 - (progn 30 - (chdir 31 - forest 32 - (progn 33 - (run %{bin:test-errors})))))) 34 - 35 - (rule 36 - (alias runtest) 37 - (deps 38 - (glob_files forest/**)) 39 - (action 40 - (diff Test_errors.expected Test_errors.out))) 41 - 42 5 (test 43 6 (name Test_uri_util) 44 7 (libraries