Skip to content

Commit

Permalink
test: test cases for bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Oudwins committed Jul 7, 2024
1 parent a980487 commit aaa3bfa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/twmerge/validators_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package twmerge

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestArbitraryShadow(t *testing.T) {
assert.Equal(t, IsArbitraryShadow("[inset_0_1px_0,inset_0_-1px_0]"), true)
assert.Equal(t, IsArbitraryShadow("[0_35px_60px_-15px_rgba(0,0,0,0.3)]"), true)
assert.Equal(t, IsArbitraryShadow("[inset_0_1px_0,inset_0_-1px_0]"), true)
assert.Equal(t, IsArbitraryShadow("[0_0_#00f]"), true)
assert.Equal(t, IsArbitraryShadow("[.5rem_0_rgba(5,5,5,5)]"), true)
assert.Equal(t, IsArbitraryShadow("[-.5rem_0_#123456]"), true)
assert.Equal(t, IsArbitraryShadow("[0.5rem_-0_#123456]"), true)
assert.Equal(t, IsArbitraryShadow("[0.5rem_-0.005vh_#123456]"), true)
assert.Equal(t, IsArbitraryShadow("[0.5rem_-0.005vh]"), true)

assert.Equal(t, IsArbitraryShadow("[rgba(5,5,5,5)]"), false)
assert.Equal(t, IsArbitraryShadow("[#00f]"), false)
assert.Equal(t, IsArbitraryShadow("[something-else]"), false)
}

0 comments on commit aaa3bfa

Please sign in to comment.