import { isNumber } from "./math";

test("should return true for valid numbers", () => {
	expect(isNumber(42)).toEqual({ is: true, value: 42 });
	expect(isNumber(0)).toEqual({ is: true, value: 0 });
	expect(isNumber(-10)).toEqual({ is: true, value: -10 });
	expect(isNumber(-10.123123)).toEqual({ is: true, value: -10.123123 });
	expect(isNumber(-10.00000)).toEqual({ is: true, value: -10 });
});

test("should return false for non-number values", () => {
	expect(isNumber(null)).toEqual({ is: false, value: 0 });
	expect(isNumber(undefined)).toEqual({ is: false, value: NaN });
	expect(isNumber("42")).toEqual({ is: false, value: 42 });
	expect(isNumber(NaN)).toEqual({ is: false, value: NaN });
	expect(isNumber(Infinity)).toEqual({ is: false, value: Infinity });
	expect(isNumber(-Infinity)).toEqual({ is: false, value: -Infinity });
});

