Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for slicesEqual (0.21 sec)

  1. internal/mountinfo/mountinfo_linux_test.go

    func mountPointsEqual(a, b mountInfo) bool {
    	if a.Device != b.Device || a.Path != b.Path || a.FSType != b.FSType || !slicesEqual(a.Options, b.Options) || a.Pass != b.Pass || a.Freq != b.Freq {
    		return false
    	}
    	return true
    }
    
    // Checks if two string slices are equal.
    func slicesEqual(a, b []string) bool {
    	if len(a) != len(b) {
    		return false
    	}
    	for i := range a {
    		if a[i] != b[i] {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  2. test/typeparam/setsimp.dir/main.go

    	}
    	if s1.Contains(5) {
    		panic(fmt.Sprintf("(%v).Contains(5) == true, want false", s1))
    	}
    	vals := s1.Values()
    	sort.Ints(vals)
    	w1 := []int{1, 2, 3, 4}
    	if !a.SliceEqual(vals, w1) {
    		panic(fmt.Sprintf("(%v).Values() == %v, want %v", s1, vals, w1))
    	}
    }
    
    func TestEqual() {
    	s1 := a.Make[string]()
    	s2 := a.Make[string]()
    	if !a.Equal(s1, s2) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 3.2K bytes
    - Viewed (0)
  3. test/typeparam/chansimp.dir/main.go

    	"time"
    )
    
    func TestReadAll() {
    	c := make(chan int)
    	go func() {
    		c <- 4
    		c <- 2
    		c <- 5
    		close(c)
    	}()
    	got := a.ReadAll(context.Background(), c)
    	want := []int{4, 2, 5}
    	if !a.SliceEqual(got, want) {
    		panic(fmt.Sprintf("ReadAll returned %v, want %v", got, want))
    	}
    }
    
    func TestMerge() {
    	c1 := make(chan int)
    	c2 := make(chan int)
    	go func() {
    		c1 <- 1
    		c1 <- 3
    		c1 <- 5
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  4. test/typeparam/metrics.go

    	}
    	if got, want := m1.Metrics(), []string{"a"}; !_SlicesEqual(got, want) {
    		panic(fmt.Sprintf("Metrics = %v, want %v", got, want))
    	}
    
    	m2 := _Metric2[int, float64]{}
    	m2.Add(1, 1)
    	m2.Add(2, 2)
    	m2.Add(3, 3)
    	m2.Add(3, 3)
    	k1, k2 := m2.Metrics()
    
    	sort.Ints(k1)
    	w1 := []int{1, 2, 3}
    	if !_SlicesEqual(k1, w1) {
    		panic(fmt.Sprintf("_Metric2.Metrics first slice = %v, want %v", k1, w1))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  5. test/typeparam/mapsimp.dir/main.go

    	sort.Ints(got1)
    	if !a.SliceEqual(got1, want) {
    		panic(fmt.Sprintf("a.Keys(%v) = %v, want %v", m1, got1, want))
    	}
    
    	got2 := a.Keys(m2)
    	sort.Ints(got2)
    	if !a.SliceEqual(got2, want) {
    		panic(fmt.Sprintf("a.Keys(%v) = %v, want %v", m2, got2, want))
    	}
    }
    
    func TestValues() {
    	got1 := a.Values(m1)
    	want1 := []int{2, 4, 8, 16}
    	sort.Ints(got1)
    	if !a.SliceEqual(got1, want1) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  6. test/typeparam/mapsimp.dir/a.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package a
    
    // SliceEqual reports whether two slices are equal: the same length and all
    // elements equal. All floating point NaNs are considered equal.
    func SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 24 22:17:33 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  7. test/typeparam/setsimp.dir/a.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package a
    
    // SliceEqual reports whether two slices are equal: the same length and all
    // elements equal. All floating point NaNs are considered equal.
    func SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 26 21:39:54 UTC 2021
    - 2.7K bytes
    - Viewed (0)
  8. test/typeparam/orderedmapsimp.dir/main.go

    		var r []int
    		for {
    			_, v, ok := it.Next()
    			if !ok {
    				return r
    			}
    			r = append(r, v)
    		}
    	}
    	got := gather(m.Iterate())
    	want := []int{'a', 'b', 'x'}
    	if !a.SliceEqual(got, want) {
    		panic(fmt.Sprintf("Iterate returned %v, want %v", got, want))
    	}
    
    }
    
    func main() {
    	TestMap()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  9. test/typeparam/chansimp.dir/a.go

    package a
    
    import (
    	"context"
    	"runtime"
    )
    
    // Equal reports whether two slices are equal: the same length and all
    // elements equal. All floating point NaNs are considered equal.
    func SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 5.5K bytes
    - Viewed (0)
  10. test/typeparam/orderedmapsimp.dir/a.go

    	}
    	return keyval.key, keyval.val, true
    }
    
    // Equal reports whether two slices are equal: the same length and all
    // elements equal. All floating point NaNs are considered equal.
    func SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 5.5K bytes
    - Viewed (0)
Back to top