@use 'true' as test;
@use '../svg';

@include test.describe('escape function') {
    @include test.it('should escape characters within an SVG string not wrapped in url()') {
        $input: 'data:image/svg+xml,<path d="M10 10"></path>';
        $expected-output: 'data:image/svg+xml,%3Cpath%20d=%22M10%2010%22%3E%3C/path%3E';

        @include test.assert() {
            @include test.output(svg.escape($input));
            @include test.expect($expected-output);
        }
    }

    @include test.it('should escape characters within an SVG string wrapped in url()') {
        $input: url('data:image/svg+xml,<path d="M10 10"></path>');
        $expected-output: url('data:image/svg+xml,%3Cpath%20d=%22M10%2010%22%3E%3C/path%3E');

        @include test.assert() {
            @include test.output(svg.escape($input));
            @include test.expect($expected-output);
        }
    }
}
