Skip to content

Commit 59abce8

Browse files
Skip Unsafe access errors
1 parent d524310 commit 59abce8

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

build.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(defmacro opts+ []
99
`(assoc ~'opts
1010
:lib 'com.clojure-goes-fast/clj-memory-meter
11-
:version "0.2.1"
11+
:version "0.2.2-SNAPSHOT"
1212
:resource-dirs ["res"]
1313
:src-pom "res/pom-template.xml"))
1414

deps.edn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
:test {:extra-paths ["test"]
1414
:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.0"
15-
:git/sha "48c3c67"}}
15+
:git/sha "48c3c67"}
16+
;; Dependency only to test the error skipping behavior.
17+
org.spdx/java-spdx-library {:mvn/version "1.1.2"}}
1618
:exec-fn cognitect.test-runner.api/test
1719
:jvm-opts ["-Djdk.attach.allowAttachSelf"]}}}

res/jamm-0.4.0-unsafe.jar

220 Bytes
Binary file not shown.

test/clj_memory_meter/core_test.clj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns clj-memory-meter.core-test
22
(:require [clj-memory-meter.core :as sut]
3-
[clojure.test :refer :all]))
3+
[clojure.test :refer :all])
4+
(:import org.spdx.library.model.license.LicenseInfoFactory))
45

56
(deftest basic-test
67
(is (= 240 (sut/measure [] :bytes true)))
@@ -13,3 +14,6 @@
1314
(is (= "240 B" (sut/measure [])))
1415
(is (= "3.1 KiB" (sut/measure (vec (range 100)))))
1516
(is (= "2.8 MiB" (sut/measure (vec (range 100000))))))
17+
18+
(deftest error-test
19+
(is (< 100000 (sut/measure (LicenseInfoFactory/getListedLicenseById "Apache-2.0") :bytes true))))

0 commit comments

Comments
 (0)