From 7da1fada8dd795543e12c6aa0371cc1149a42be6 Mon Sep 17 00:00:00 2001 From: Asko Nomm Date: Thu, 7 Apr 2022 11:26:12 +0200 Subject: Add core overall test and fix code block ending being broken. --- resources/test/parsers/code_block_result.html | 3 ++- src/clarktown/parsers/code_block.clj | 2 +- test/clarktown/core_test.clj | 10 ++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/test/parsers/code_block_result.html b/resources/test/parsers/code_block_result.html index e95e481..21b9214 100644 --- a/resources/test/parsers/code_block_result.html +++ b/resources/test/parsers/code_block_result.html @@ -35,4 +35,5 @@ function markdownToHTML(markdown) { }); // And at last, join the blocks together for one big block. - return parsedBlocks.join(""); \ No newline at end of file + return parsedBlocks.join(""); +} \ No newline at end of file diff --git a/src/clarktown/parsers/code_block.clj b/src/clarktown/parsers/code_block.clj index a5de41c..388776f 100644 --- a/src/clarktown/parsers/code_block.clj +++ b/src/clarktown/parsers/code_block.clj @@ -18,7 +18,7 @@ second) code (as-> block n (string/replace-first n #"\`\`\`(\w+)?\n" "") - (subs n 0 (- (count n) 5)) + (subs n 0 (- (count n) 4)) (string/replace n #"&" "&") (string/replace n #"<" "<") (string/replace n #">" ">") diff --git a/test/clarktown/core_test.clj b/test/clarktown/core_test.clj index da252c7..8a2ee58 100644 --- a/test/clarktown/core_test.clj +++ b/test/clarktown/core_test.clj @@ -1,4 +1,10 @@ (ns clarktown.core-test (:require - [clojure.test :refer :all] - [clarktown.core :refer :all])) \ No newline at end of file + [clojure.test :refer [deftest testing is]] + [clarktown.core :as core])) + + +(deftest overall-test + (testing "Overall" + (is (= (slurp "./resources/test/core_result.html") + (core/render (slurp "./resources/test/core.md")))))) \ No newline at end of file -- cgit v1.2.3