mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
Source files keep their SPDX-License-Identifier and Hanzo copyright line; the Gitea, Gogs and LFS Test Server copyrights they used to repeat now live once in NOTICE, alongside LICENSE. The header lint accepts any copyright line above the SPDX line, so it no longer demands an upstream one. Co-authored-by: Hanzo Dev <[email protected]>
30 lines
636 B
Go
30 lines
636 B
Go
// Copyright 2026 Hanzo AI, Inc. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package svg
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNormalize(t *testing.T) {
|
|
res := Normalize([]byte("foo"), 1)
|
|
assert.Equal(t, "foo", string(res))
|
|
|
|
res = Normalize([]byte(`<?xml version="1.0"?>
|
|
<!--
|
|
comment
|
|
-->
|
|
<svg xmlns = "...">content</svg>`), 1)
|
|
assert.Equal(t, `<svg width="1" height="1" class="svg">content</svg>`, string(res))
|
|
|
|
res = Normalize([]byte(`<svg
|
|
width="100"
|
|
class="svg-icon"
|
|
>content</svg>`), 16)
|
|
|
|
assert.Equal(t, `<svg class="svg-icon" width="16" height="16">content</svg>`, string(res))
|
|
}
|