Skip to content

Commit

Permalink
Run #190 test
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashkumar authored Sep 29, 2024
1 parent 9a71c1f commit c024493
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -964,3 +964,32 @@ func TestWrite_OverrideMissingTransferSyntax(t *testing.T) {
})
}
}

func MustNewValue(data interface{}) dicom.Value {

Check failure on line 968 in write_test.go

View workflow job for this annotation

GitHub Actions / Build and Test

undefined: dicom

Check failure on line 968 in write_test.go

View workflow job for this annotation

GitHub Actions / Benchmark (push)

undefined: dicom
value, err := NewValue(data)
if err != nil {
panic(fmt.Errorf("error writing value: %w", err))

Check failure on line 971 in write_test.go

View workflow job for this annotation

GitHub Actions / Build and Test

undefined: fmt

Check failure on line 971 in write_test.go

View workflow job for this annotation

GitHub Actions / Benchmark (push)

undefined: fmt
}

return value
}

func ExampleIssue190(t *testing.T) {
dataset := Dataset{
Elements: []*dicom.Element{

Check failure on line 979 in write_test.go

View workflow job for this annotation

GitHub Actions / Build and Test

undefined: dicom

Check failure on line 979 in write_test.go

View workflow job for this annotation

GitHub Actions / Benchmark (push)

undefined: dicom
&dicom.Element{

Check failure on line 980 in write_test.go

View workflow job for this annotation

GitHub Actions / Build and Test

undefined: dicom

Check failure on line 980 in write_test.go

View workflow job for this annotation

GitHub Actions / Benchmark (push)

undefined: dicom
Tag: tag.SmallestImagePixelValue,
ValueRepresentation: tag.VRUInt16List,
RawValueRepresentation: "US",
ValueLength: 0,
Value: MustNewValue([]int{1}),
},
},
}

buffer := new(bytes.Buffer)
err := Write(buffer, dataset, dicom.DefaultMissingTransferSyntax())

Check failure on line 991 in write_test.go

View workflow job for this annotation

GitHub Actions / Build and Test

undefined: dicom

Check failure on line 991 in write_test.go

View workflow job for this annotation

GitHub Actions / Benchmark (push)

undefined: dicom
if err != nil {
t.Errorf("unexpected error: %v", err)
}
}

0 comments on commit c024493

Please sign in to comment.