Passed
Push — main ( 99f745...37559a )
by Igor
01:58
created

validation_test.TestPropertyPath_String   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
package validation_test
2
3
import (
4
	"testing"
5
6
	"github.com/muonsoft/validation"
7
	"github.com/stretchr/testify/assert"
8
)
9
10
func TestPropertyPath_String(t *testing.T) {
11
	var path *validation.PropertyPath
12
	path = path.WithProperty("array").WithIndex(1).WithProperty("property")
13
14
	formatted := path.String()
15
16
	assert.Equal(t, "array[1].property", formatted)
17
}
18