-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Tweak the storage function to use the component schema
- Loading branch information
Showing
2 changed files
with
24 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
(ns elin.function.storage.test | ||
(:require | ||
[elin.protocol.storage :as e.p.storage] | ||
[elin.schema.handler :as e.s.handler] | ||
[elin.schema.component :as e.s.component] | ||
[malli.core :as m])) | ||
|
||
(def ^:private last-test-query-key ::last-test-query) | ||
(def ^:private last-failed-tests-key ::last-failed-tests) | ||
|
||
(m/=> set-last-test-query [:=> [:cat e.s.handler/?Elin string?] :nil]) | ||
(defn set-last-test-query | ||
[{:component/keys [session-storage]} query] | ||
(e.p.storage/set session-storage last-test-query-key query)) | ||
(m/=> set* [:=> [:cat keyword? e.s.component/?Storage string?] :nil]) | ||
(defn- set* | ||
[storage-key storage query] | ||
(e.p.storage/set storage storage-key query)) | ||
|
||
(m/=> get-last-test-query [:=> [:cat e.s.handler/?Elin] string?]) | ||
(defn get-last-test-query | ||
[{:component/keys [session-storage]}] | ||
(e.p.storage/get session-storage last-test-query-key)) | ||
(m/=> get* [:=> [:cat keyword? e.s.component/?Storage] string?]) | ||
(defn- get* | ||
[storage-key storage] | ||
(e.p.storage/get storage storage-key)) | ||
|
||
(def set-last-test-query (partial set* last-test-query-key)) | ||
(def get-last-test-query (partial get* last-test-query-key)) | ||
|
||
(def set-last-failed-tests-query (partial set* last-failed-tests-key)) | ||
(def get-last-failed-tests-query (partial get* last-failed-tests-key)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters