/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2008, Red Hat Middleware LLC, and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors. 
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.jboss.dna.common.junit;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.jboss.dna.common.junit.IsCloseTo.closeTo;
import org.junit.Test;

/**
 * @author Randall Hauch
 */
public class IsCloseToTest {

    @Test( expected = AssertionError.class )
    public void shouldFailWhenNumberIsNotCloserToValue() {
        assertThat(100.0001d, is(closeTo(100.0d, 0.1d)));
    }

    @Test
    public void shouldPassWhenNumberIsCloserToValue() {
        assertThat(100.0001d, is(closeTo(100.0d, 0.0000999d)));
        assertThat(-100.0001d, is(closeTo(-100.0d, 0.0000999d)));
    }

}

@@ -1412,35 +1412,32 @@
  assertThat(100.
-000
 1d, is(closeTo(1
@@ -1445,16 +1445,18 @@
 0.0d, 0.
+00
 1d)));%0A 
@@ -1572,37 +1572,33 @@
 eTo(100.0d, 0.00
-00999
+1
 d)));%0A        as
@@ -1646,13 +1646,9 @@
 0.00
-00999
+1
 d)))

Corrected test cases.