From 5ee6897ce6a8060d1c17994531b9255798d662af Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 31 Jan 2021 20:06:57 +0100 Subject: [PATCH] :tada: Add tests for svgc. --- backend/tests/app/tests/test_svgc.clj | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 backend/tests/app/tests/test_svgc.clj diff --git a/backend/tests/app/tests/test_svgc.clj b/backend/tests/app/tests/test_svgc.clj new file mode 100644 index 000000000..63b5f8962 --- /dev/null +++ b/backend/tests/app/tests/test_svgc.clj @@ -0,0 +1,24 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; This Source Code Form is "Incompatible With Secondary Licenses", as +;; defined by the Mozilla Public License, v. 2.0. +;; +;; Copyright (c) 2021 UXBOX Labs SL + +(ns app.tests.test-svgc + (:require + [app.tests.helpers :as th] + [clojure.java.io :as io] + [clojure.test :as t] + [mockery.core :refer [with-mocks]])) + +(t/use-fixtures :once th/state-init) + +(t/deftest run-svgc-over-sample-file + (let [svgc (:app.svgparse/svgc th/*system*) + data (slurp (io/resource "app/tests/_files/sample1.svg")) + res (svgc data)] + (t/is (string? res)) + (t/is (= 2533 (count res)))))