New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defer dereferences of metaconstants in function fakes #390
Changes from all commits
f2f0cfb
5c00582
5ed6f0c
9fcd99d
ca8eb0f
e030fd5
0f0f3b4
0455919
7ef99e9
7f903c6
975cad1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,22 +145,42 @@ | |
(provided | ||
--mc-- =contains=> {:c 50000}))) | ||
|
||
(unfinished gen-doc) | ||
(fact "Test merging of metaconstant that appear in data and function fakes" | ||
(:header (gen-doc)) => "gamma" | ||
(provided | ||
(gen-doc) => ..doc.. | ||
..doc.. =contains=> {:header "gamma"})) | ||
|
||
(fact "Test merging of nested metaconstant that appear in data and function fakes" | ||
(:header (:raw (gen-doc))) => "gamma" | ||
(provided | ||
(gen-doc) => {:raw ..doc..} | ||
..doc.. =contains=> {:header "gamma"})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would happen in the following:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aah, nice example! It breaks the code, though I had to tweak it to be valid midje DSL code because
results in
I'll add this as a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would the following maintain the same behavior as now?
What about this:
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These continue to pass. Before they passed because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool. Do you think it would be worth adding this test to the suite? |
||
|
||
(against-background [..doc.. =contains=> {:header "gamma"}] | ||
(fact "Test merging of metaconstant with against-background" | ||
(:header (gen-doc)) => "gamma" | ||
(provided | ||
(gen-doc) => ..doc..))) | ||
|
||
(against-background [..doc.. =contains=> {:header ..header..} | ||
..header.. =contains=> {:title "title"}] | ||
(future-fact "Test metaconstants that contain other metaconstants" | ||
(-> (gen-doc) :header :title) => "title" | ||
(provided | ||
(gen-doc) => ..doc..))) | ||
|
||
(future-fact "Test metaconstants that contain other metaconstants" | ||
(-> (gen-doc) :header :title) => "title" | ||
(provided | ||
(gen-doc) => ..doc.. | ||
..doc.. =contains=> {:header ..header..} | ||
..header.. =contains=> {:title "title"})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the two |
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
;;;; | ||
|
||
;;; Use with prerequisite functions | ||
|
||
|
||
(future-fact "Metaconstant merging and streaming" | ||
(vector (:header (gen-doc)) (:header (gen-doc))) => [1 2] | ||
(provided | ||
(gen-doc) =streams=> [..doc1.. ..doc2..] | ||
..doc1.. =contains=> {:header 1} | ||
..doc2.. =contains=> {:header 2})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that
(intern *ns* symbol (Metaconstant. symbol {} nil))
was being run multiple times for the same symbol. Figured it makes sense to filter out duplicates.