Help us shape the future of Go! Take the 2026 Go Developer Survey

Source file src/simd/internal/spec/string_test.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package spec
     6  
     7  import "testing"
     8  
     9  func TestString(t *testing.T) {
    10  	assertFn1[Vec[int32, Width128], string](t, String, "String",
    11  		{{1, -2, 3, -4}, "{1,-2,3,-4}"},
    12  	)
    13  	assertFn1[Vec[uint64, Width128], string](t, String, "String",
    14  		{{1<<64 - 1, 0}, "{18446744073709551615,0}"},
    15  	)
    16  	assertFn1[Vec[float64, Width128], string](t, String, "String",
    17  		{{1.5, -0.25}, "{1.5,-0.25}"},
    18  	)
    19  	assertFn1[Vec[Mask32, Width128], string](t, StringMask, "StringMask",
    20  		{{^Mask32(0), 0, ^Mask32(0), 0}, "{1,0,1,0}"},
    21  	)
    22  	assertFn1[Vec[Mask64, Width128], string](t, StringMask, "StringMask",
    23  		{{0, ^Mask64(0)}, "{0,1}"},
    24  	)
    25  }
    26  

View as plain text