helper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';

function assert_is_equal_with_clamping_number(input, result) {
  const number = input.to('number');

  if (number.value < 0)
    assert_style_value_equals(result, new CSSUnitValue(0, 'number'));
  else if (number.value > 1)
    assert_style_value_equals(result, new CSSUnitValue(1, 'number'));
  else
    assert_style_value_equals(result, input);
}

function assert_is_equal_with_clamping_per