Permalink
Browse files

More tests, fortunately not finding new bugs

  • Loading branch information...
1 parent aebfa7a commit e7d8120d720033d66fe46e395847f2873cc97396 @lvh committed Mar 5, 2014
Showing with 12 additions and 2 deletions.
  1. +12 −2 test/hood/core_test.clj
View
@@ -17,6 +17,16 @@
(is (not (needs-alloc? {:state :something-else})))))
(deftest one-pass-alloc-tests
- (testing "one app, requests > budget, not accepting less"
+ (testing "one app, requests < offer"
+ (let [app {:requested-grant 100}]
+ (is (= (one-pass-alloc [app] 200 true)
+ {app 100}))
+ (is (= (one-pass-alloc [app] 200 false)
+ {app 100}))))
+ (testing "one app, requests > offer, not accepting less"
(is (= (one-pass-alloc [{:requested-grant 100}] 1 false)
- {}))))
+ {})))
+ (testing "one app, requests > offer, accepting less"
+ (is (let [app {:requested-grant 100}]
+ (= (one-pass-alloc [app] 1 true)
+ {app 1})))))

0 comments on commit e7d8120

Please sign in to comment.