File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 94
94
95
95
(defn matches? [^String template ^String uri]
96
96
" Indicates if a given URI has at least one match against a URI template"
97
- (if (empty? (match-variables template uri))
98
- false
99
- true ))
97
+ (or (not (empty? (match-variables template uri)))
98
+ (= template uri)))
100
99
101
100
(defn fill-with-nulls [^String template]
102
101
" Create a version of the template with all variables set to ASCII
Original file line number Diff line number Diff line change 69
69
(is (not (matches? template uri2)))
70
70
(is (not (matches? template uri3)))))
71
71
72
+ (deftest matches?-with-no-template-vars-test
73
+ (let
74
+ [template " http://www.example.org/no-template-vars"
75
+ uri1 " http://www.example.org/no-template-vars"
76
+ uri2 " http://www.example.org/other" ]
77
+ (is (matches? template uri1))
78
+ (is (not (matches? template uri2)))))
79
+
72
80
(deftest fill-with-nulls-test
73
81
(let
74
82
[template " http://www.example.org/bla/{var}/{hello}"
You can’t perform that action at this time.
0 commit comments