/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.math;

import net.ranides.assira.math.Numeric;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author ranides
 */
public class NumericTest {


    public NumericTest() {
    }



    @Test
    public void testEngineer() {

        assertEquals(128L, Numeric.asLong("128", -1));
        assertEquals(128L * 1024L * 1024L, Numeric.asLong("128M", -1));
        assertEquals(128L * 1024L * 1024L, Numeric.asLong("128MB", -1));
        assertEquals(16L * 1024L * 1024L, Numeric.asLong("128Mb", -1));
        assertEquals(16L * 1000L * 1000L, Numeric.asLong("128mb", -1));

        assertEquals(128L * 1024L * 1024L, Numeric.asLong("1 28 M", -1));
        assertEquals(128L * 1024L * 1024L, Numeric.asLong("1 2 8 MB", -1));
        assertEquals(16L * 1024L * 1024L, Numeric.asLong("128  Mb", -1));


    }
}
