<commit_before>;;; Merkki - a Clojure library for Markdown generation
;;;
;;; Copyright (c) 2016 <NAME> III
;;;
;;; This file is licensed under the Eclipse Public License v1.0. See LICENSE for more details

(ns merkki.core-test
  (:require #?(:clj [clojure.test :refer :all]
               :cljs [cljs.test :refer-macros [deftest testing is]])
            #?(:clj [clojure.java.io :as io])
            [merkki.core :refer [markdown]]))

;;;
;;; Markdown test
;;;

(deftest markdown-test
  (testing "Given a vector of block elements, return a string of markdown formatted text"
    (is (= (let [test-text (markdown
                            [[:uh1 "Markdown Test"]
                             "This is a test of the merkki markdown rendering system."
                             [:h2 "Span Elements"]
                             ["A subvector of strings can be passed, allowing usage of span elements like "
                              [:em "emphasized"] ", " [:strong "strong"] ", " [:link "links" "http://www.google.com"] ", and "
                              [:code "code"] ". We can also do auto-links like so: " [:auto-link "http://www.github.com/jarcane/merkki"] "."]
                             [:image
                              "Here's a pug to show off images."
                              "https://pbs.twimg.com/profile_images/378800000515894032/0758bced4b2f071fbf9916e15d28e7a8.jpeg"]
                             [:h2 "Block Elements"]
                             [:ol
                              "Here"
                              "Is"
                              "An"
                              "Ordered"
                              "List"]
                             [:ul
                              "Here's"
                              "An"
                              "Unordered"
                              "List"]
                             [:code-block
                              "(defn some-code [] \"Hello World!\")"]
                             [:blockquote
                              "Here is a big long block quote that is too long"
                              "so we've made it onto multiple lines because that"
                              "is just how we roll."]])]
             (spit "/tmp/merkki-temp.md" test-text)
             test-text)
           #?(:clj (slurp (io/resource "merkki-test.md"))
              :cljs ""))))) ;; FIXME: Find alternate method to bring in test spec doc in CLJS<commit_msg>Removed unnecessary tmp file output from core test<commit_after>;;; Merkki - a Clojure library for Markdown generation
;;;
;;; Copyright (c) 2016 <NAME> III
;;;
;;; This file is licensed under the Eclipse Public License v1.0. See LICENSE for more details

(ns merkki.core-test
  (:require #?(:clj [clojure.test :refer :all]
               :cljs [cljs.test :refer-macros [deftest testing is]])
            #?(:clj [clojure.java.io :as io])
            [merkki.core :refer [markdown]]))

;;;
;;; Markdown test
;;;

(deftest markdown-test
  (testing "Given a vector of block elements, return a string of markdown formatted text"
    (is (= (markdown
            [[:uh1 "Markdown Test"]
             "This is a test of the merkki markdown rendering system."
             [:h2 "Span Elements"]
             ["A subvector of strings can be passed, allowing usage of span elements like "
              [:em "emphasized"] ", " [:strong "strong"] ", " [:link "links" "http://www.google.com"] ", and "
              [:code "code"] ". We can also do auto-links like so: " [:auto-link "http://www.github.com/jarcane/merkki"] "."]
             [:image
              "Here's a pug to show off images."
              "https://pbs.twimg.com/profile_images/378800000515894032/0758bced4b2f071fbf9916e15d28e7a8.jpeg"]
             [:h2 "Block Elements"]
             [:ol
              "Here"
              "Is"
              "An"
              "Ordered"
              "List"]
             [:ul
              "Here's"
              "An"
              "Unordered"
              "List"]
             [:code-block
              "(defn some-code [] \"Hello World!\")"]
             [:blockquote
              "Here is a big long block quote that is too long"
              "so we've made it onto multiple lines because that"
              "is just how we roll."]])
           #?(:clj (slurp (io/resource "merkki-test.md"))
              :cljs ""))))) ;; FIXME: Find alternate method to bring in test spec doc in CLJS
{'fraction_non_alphanumeric': 0.12047384890478319, 'fraction_numerical': 0.02056325435851587, 'mean_word_length': 1.396893411890734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2330841', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1238, 'n_words': 386}