import { describe, it, expect } from 'vitest';
import { parseUren } from './uren';

describe('parseUren', () => {
  it('accepts non-negative whole numbers, including 0', () => {
    for (const [raw, n] of [['0', 0], [' 40 ', 40], ['1000', 1000]] as const) {
      const r = parseUren(raw);
      expect(r.ok).toBe(true);
      if (r.ok) expect(r.value).toBe(n);
    }
  });

  it('rejects empty, negative, and non-integer input', () => {
    expect(parseUren('').ok).toBe(false);
    expect(parseUren('-1').ok).toBe(false);
    expect(parseUren('1.5').ok).toBe(false);
    expect(parseUren('abc').ok).toBe(false);
  });
});
