1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 tvcm.require('tvcm.utils');
9 tvcm.unittest.testSuite('tvcm.utils_test', function() {
10 test('clamping', function() {
11 assertEquals(2, tvcm.clamp(2, 1, 3));
12 assertEquals(1, tvcm.clamp(1, 1, 3));
13 assertEquals(1, tvcm.clamp(0, 1, 3));
14 assertEquals(3, tvcm.clamp(3, 1, 3));
15 assertEquals(3, tvcm.clamp(4, 1, 3));