import { describe, it, expect } from 'vitest';
import { key, sleep } from '../utils';

describe('Utils', () => {
  describe('key', () => {
    it('should generate correct key string', () => {
      expect(key(1, 2)).toBe('1,2');
      expect(key(0, 0)).toBe('0,0');
      expect(key(-5, 10)).toBe('-5,10');
    });
  });

  describe('sleep', () => {
    it('should resolve after delay', async () => {
      const start = Date.now();
      await sleep(10);
      const end = Date.now();
      expect(end - start).toBeGreaterThanOrEqual(10);
    });
  });
});
