OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <script> | 8 <script> |
9 'use strict'; | 9 'use strict'; |
10 | 10 |
11 // TODO(charliea): Investigate whether we could make this a Chai plugin. | 11 // TODO(charliea): Investigate whether we could make this a Chai plugin. |
12 /** | 12 /** |
13 * @fileoverview Provides assert functions that are not available on the Chai | 13 * @fileoverview Provides assert functions that are not available on the Chai |
14 * assert module. | 14 * assert module. |
15 */ | 15 */ |
16 tr.exportTo('tr.b', function() { | 16 tr.exportTo('tr.b', function() { |
17 /** | 17 /** |
18 * Throws if the range |actual| is not equal to the range |expected| (using | 18 * Throws if the range |actual| is not equal to the range |expected| (using |
19 * tr.b.Range.equals). | 19 * tr.b.math.Range.equals). |
20 */ | 20 */ |
21 function assertRangeEquals(actual, expected) { | 21 function assertRangeEquals(actual, expected) { |
22 assert(actual.equals(expected), | 22 assert(actual.equals(expected), |
23 'Expected Range(' + actual.min + ', ' + actual.max + ') to be ' + | 23 'Expected Range(' + actual.min + ', ' + actual.max + ') to be ' + |
24 'Range(' + expected.min + ', ' + expected.max + ')'); | 24 'Range(' + expected.min + ', ' + expected.max + ')'); |
25 } | 25 } |
26 | 26 |
27 return { | 27 return { |
28 assertRangeEquals, | 28 assertRangeEquals, |
29 }; | 29 }; |
30 }); | 30 }); |
31 </script> | 31 </script> |
OLD | NEW |