This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-29
Channels
- # aatree (1)
- # admin-announcements (7)
- # announcements (3)
- # beginners (125)
- # boot (164)
- # braid-chat (8)
- # cider (26)
- # cljsrn (37)
- # clojars (3)
- # clojure (162)
- # clojure-argentina (1)
- # clojure-art (2)
- # clojure-berlin (5)
- # clojure-czech (3)
- # clojure-ireland (1)
- # clojure-miami (1)
- # clojure-norway (9)
- # clojure-russia (47)
- # clojurebridge (1)
- # clojurescript (151)
- # community-development (1)
- # conf-proposals (80)
- # core-async (15)
- # core-matrix (1)
- # cursive (66)
- # datomic (26)
- # emacs (17)
- # events (10)
- # funcool (59)
- # hoplon (43)
- # incanter (2)
- # jobs (10)
- # ldnclj (8)
- # lein-figwheel (18)
- # luminus (1)
- # off-topic (19)
- # om (144)
- # onyx (167)
- # overtone (9)
- # parinfer (12)
- # pedestal (1)
- # proton (158)
- # re-frame (139)
- # reagent (48)
- # test-check (19)
- # testing (43)
So I was hoping to get some advice about the properties I could test for the convert function found at https://github.com/paulspencerwilliams/gormanic/blob/master/src/gormanic/core.clj
testing the string generated by convert will be a bit annoying
but you could test the functions that it uses
some easy ones, do any of them return a negative month, day, year
or a month larger than 12 (or 11 if 0 indexed), day greater than 31, tec
I understand testing the boundaries aren’t crossed like you mentioned. If I returning a map rather than string, with day, month and year keys, it would be easier to ‘parse’ and thus test. Would quickcheck style testing help then?
Would I use it to test the function actually returns the correct resultant date? I was thinking that I would have to model the gormanic calendar in the test, and for a random set of input dates, ensure convert would return the appropriate gormanic date. But this would be in effect duplicating SUT code in the test?
Apologies, if I’ve asked a common question, I’ve watched a few videos etc but many properties seem abstract, or away from the concrete problem if that makes sense?
Yeah, a map definitely seems easier
I don’t know enough about the gormanic calender to provide some good properties there 😕
The wikipedia page isn’t all that much help, heh
One idea is if you could provide a comparator function for both date types, and make sure that if one random date is greater than another random date in the gregorian calender, then it’s also greater in the calculated gormanic calender date.
hehe, oh sorry, the gormanic calendar is made up for a kata. okay, I need to think about your idea for the comparator function. If I developed one, would you not simply say that for all inputs, the output compares exactly to the input?
Exactly
okay. Cheers, let me think about that and I’ll have a play.