mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
405aa66357
Also optimizes some functions for faster shape and rect props access (there is still a lot of work ahead optimizing the rest of the functions) Also normalizes shape creation and validation for ensuring correct setup of all the mandatory properties.
57 lines
1.5 KiB
Clojure
57 lines
1.5 KiB
Clojure
;; 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/.
|
|
;;
|
|
;; Copyright (c) KALEIDOS INC
|
|
|
|
(ns user
|
|
(:require
|
|
[app.common.schema :as sm]
|
|
[app.common.schema.desc-js-like :as smdj]
|
|
[app.common.schema.desc-native :as smdn]
|
|
[app.common.schema.generators :as sg]
|
|
[app.common.pprint :as pp]
|
|
[clojure.java.io :as io]
|
|
[clojure.pprint :refer [pprint print-table]]
|
|
[clojure.repl :refer :all]
|
|
[clojure.spec.alpha :as s]
|
|
[clojure.spec.gen.alpha :as sgen]
|
|
[clojure.test :as test]
|
|
[clojure.test.check.generators :as tgen]
|
|
[clojure.tools.namespace.repl :as repl]
|
|
[clojure.walk :refer [macroexpand-all]]
|
|
[criterium.core :as crit]))
|
|
|
|
;; --- Benchmarking Tools
|
|
|
|
(defmacro run-quick-bench
|
|
[& exprs]
|
|
`(crit/with-progress-reporting (crit/quick-bench (do ~@exprs) :verbose)))
|
|
|
|
(defmacro run-quick-bench'
|
|
[& exprs]
|
|
`(crit/quick-bench (do ~@exprs)))
|
|
|
|
(defmacro run-bench
|
|
[& exprs]
|
|
`(crit/with-progress-reporting (crit/bench (do ~@exprs) :verbose)))
|
|
|
|
(defmacro run-bench'
|
|
[& exprs]
|
|
`(crit/bench (do ~@exprs)))
|
|
|
|
;; --- Development Stuff
|
|
|
|
(defn- run-tests
|
|
([] (run-tests #"^common-tests.*-test$"))
|
|
([o]
|
|
(repl/refresh)
|
|
(cond
|
|
(instance? java.util.regex.Pattern o)
|
|
(test/run-all-tests o)
|
|
|
|
(symbol? o)
|
|
(if-let [sns (namespace o)]
|
|
(do (require (symbol sns))
|
|
(test/test-vars [(resolve o)]))
|
|
(test/test-ns o)))))
|