File: artifact_location_test.go

package info (click to toggle)
golang-github-owenrumney-go-sarif 2.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 712 kB
  • sloc: makefile: 13
file content (17 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package sarif

import (
	"testing"

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

func Test_create_new_artifact_location(t *testing.T) {
	al := NewArtifactLocation().
		WithIndex(0).
		WithUri("file://broken.go").
		WithUriBaseId("baseId").
		WithDescription(NewMessage().WithText("message text"))

	assert.Equal(t, `{"uri":"file://broken.go","uriBaseId":"baseId","index":0,"description":{"text":"message text"}}`, getJsonString(al))
}