Skip to content

Commit

Permalink
Merge 74c4737 into e4f7a79
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f committed Oct 14, 2018
2 parents e4f7a79 + 74c4737 commit a31644c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
18 changes: 18 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
platform:
- x64

install:
- ps: Start-FileDownload 'https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat'
- lein self-install

cache:
- '%USERPROFILE%\.m2'

build: off

before_test:
- lein version

test_script:
- git submodule update --init
- lein test
12 changes: 8 additions & 4 deletions test/dhall_clj/beta_normalize_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[dhall-clj.beta-normalize :refer [beta-normalize]]
[dhall-clj.state :as s]
[dhall-clj.test-utils :refer :all]
[me.raynes.fs :as fs]))
[me.raynes.fs :as fs]
[clojure.java.io :as io]))

;; Simple tests from the spec

Expand Down Expand Up @@ -57,15 +58,18 @@
(def test-folder "dhall-haskell/tests/normalization")

(def problematic
"Here we list all the tests that blow up, so we categorize and exclude them"
"Here we list all the tests that blow up, so we categorize and exclude them.
Note: they are vectors because the path creation is platform-sensitive."
[
;; Waiting for single quote strings to be standardized
"dhall-haskell/tests/normalization/remoteSystems"])
["dhall-haskell" "tests" "normalization" "remoteSystems"]])


(defn valid-testcases []
(let [all (success-testcases test-folder)]
(apply dissoc all problematic)))
(->> problematic
(map #(->> % (apply io/file) str))
(apply dissoc all))))

(deftest normalization-suite
(doseq [[testcase {:keys [actual expected]}] (valid-testcases)]
Expand Down
9 changes: 6 additions & 3 deletions test/dhall_clj/test_utils.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns dhall-clj.test-utils
(:require [medley.core :refer [map-vals]]
[clojure.string :as string]))
[clojure.string :as string]
[clojure.java.io :as io]))


;; Credit: https://clojuredocs.org/clojure.core/tree-seq#example-54d33991e4b0e2ac61831d15
Expand All @@ -12,9 +13,11 @@
(tree-seq dir? #(.listFiles %) directory))))

(defn failure-case?
"Given a `File`, will return true if it's a failure test case."
"Given a `File`, will return true if it's a failure test case.
Note: we try to match both Windows and *nix paths."
[file]
(string/includes? (str file) "/failure/"))
(or (string/includes? (str file) "/failure/")
(string/includes? (str file) "\\failure\\")))

(defn success-testcases
"Returns a record of records {'testcase name' {:actual Text, :expected Text}}
Expand Down

0 comments on commit a31644c

Please sign in to comment.