import { describe, expect, it } from 'vitest';
import { stripQuotes } from '../string-utils.js';

describe('stripQuotes', () => {
  it('strips matching double quotes', () => {
    expect(stripQuotes('"hello"')).toBe('hello');
  });

  it('strips matching single quotes', () => {
    expect(stripQuotes("'world'")).toBe('world');
  });

  it('leaves unquoted strings unchanged', () => {
    expect(stripQuotes('no quotes')).toBe('no quotes');
  });

  it('leaves mismatched quotes unchanged', () => {
    expect(stripQuotes('"mismatched\'')).toBe('"mismatched\'');
  });

  it('leaves a single-char string unchanged', () => {
    expect(stripQuotes('"')).toBe('"');
  });

  it('handles empty string', () => {
    expect(stripQuotes('')).toBe('');
  });

  it('strips quotes around a value with spaces', () => {
    expect(stripQuotes('"a description with spaces"')).toBe('a description with spaces');
  });
});
