Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 3,295 for GOT (0.02 sec)

  1. test/typeparam/sliceimp.dir/main.go

    	}
    }
    
    func TestMin() {
    	s1 := []int{1, 2, 3, -5}
    	if got, want := a.SliceMin(s1), -5; got != want {
    		panic(fmt.Sprintf("a.Min(%v) = %d, want %d", s1, got, want))
    	}
    
    	s2 := []string{"aaa", "a", "aa", "aaaa"}
    	if got, want := a.SliceMin(s2), "a"; got != want {
    		panic(fmt.Sprintf("a.Min(%v) = %q, want %q", s2, got, want))
    	}
    
    	if got, want := a.SliceMin(s2[:0]), ""; got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 4.6K bytes
    - Viewed (0)
  2. src/regexp/find_test.go

    					t.Errorf("match %d: expected capacity %d got %d: %s", k, len(got), cap(got), test)
    				}
    				expect := test.text[e[0]:e[1]]
    				if expect != string(got) {
    					t.Errorf("match %d: expected %q got %q: %s", k, expect, got, test)
    				}
    			}
    		}
    	}
    }
    
    func TestFindAllString(t *testing.T) {
    	for _, test := range findTests {
    		result := MustCompile(test.pat).FindAllString(test.text, -1)
    		switch {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 11 15:28:50 UTC 2021
    - 16.3K bytes
    - Viewed (0)
  3. src/cmd/internal/src/pos_test.go

    			t.Errorf("%s: got col %d; want %d", test.string, got, test.col)
    		}
    
    		// relative info
    		if got := pos.RelFilename(); got != test.relFilename {
    			t.Errorf("%s: got relFilename %q; want %q", test.string, got, test.relFilename)
    		}
    		if got := pos.RelLine(); got != test.relLine {
    			t.Errorf("%s: got relLine %d; want %d", test.string, got, test.relLine)
    		}
    		if got := pos.RelCol(); got != test.relCol {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 14 23:50:26 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/errors_test.go

    	var err error_
    	want := "no error"
    	if got := err.msg(); got != want {
    		t.Errorf("empty error: got %q, want %q", got, want)
    	}
    
    	want = "foo 42"
    	err.addf(nopos, "foo %d", 42)
    	if got := err.msg(); got != want {
    		t.Errorf("simple error: got %q, want %q", got, want)
    	}
    
    	want = "foo 42\n\tbar 43"
    	err.addf(nopos, "bar %d", 43)
    	if got := err.msg(); got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 21:21:43 UTC 2024
    - 979 bytes
    - Viewed (0)
  5. test/typeparam/fact.go

    	}
    	return n * fact(n-1)
    }
    
    func main() {
    	const want = 120
    
    	if got := fact(5); got != want {
    		panic(fmt.Sprintf("got %d, want %d", got, want))
    	}
    
    	if got := fact[int64](5); got != want {
    		panic(fmt.Sprintf("got %d, want %d", got, want))
    	}
    
    	if got := fact(5.0); got != want {
    		panic(fmt.Sprintf("got %f, want %f", got, want))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 618 bytes
    - Viewed (0)
  6. src/cmd/compile/internal/test/testdata/loadstore_test.go

    		}
    	}
    	{
    		var in int32 = (1 << 30) + 1
    		var p int32
    		got := loadHitStore32(in, &p)
    		want := int64(in * in)
    		if got != want {
    			t.Errorf("testLoadHitStore (int32) failed. want = %d, got = %d", want, got)
    		}
    	}
    	{
    		var in uint32 = (1 << 30) + 1
    		var p uint32
    		got := loadHitStoreU32(in, &p)
    		want := uint64(in * in)
    		if got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 17:54:15 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  7. test/typeparam/sets.go

    		}
    	}
    }
    
    func TestSet() {
    	s1 := _Make[int]()
    	if got := s1.Len(); got != 0 {
    		panic(fmt.Sprintf("Len of empty set = %d, want 0", got))
    	}
    	s1.Add(1)
    	s1.Add(1)
    	s1.Add(1)
    	if got := s1.Len(); got != 1 {
    		panic(fmt.Sprintf("(%v).Len() == %d, want 1", s1, got))
    	}
    	s1.Add(2)
    	s1.Add(3)
    	s1.Add(4)
    	if got := s1.Len(); got != 4 {
    		panic(fmt.Sprintf("(%v).Len() == %d, want 4", s1, got))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 5.7K bytes
    - Viewed (0)
  8. test/typeparam/absdiff3.go

    }
    
    func main() {
    	if got, want := OrderedAbsDifference(1.0, -2.0), 3.0; got != want {
    		panic(fmt.Sprintf("got = %v, want = %v", got, want))
    	}
    	if got, want := OrderedAbsDifference(-1.0, 2.0), 3.0; got != want {
    		panic(fmt.Sprintf("got = %v, want = %v", got, want))
    	}
    	if got, want := OrderedAbsDifference(-20, 15), 35; got != want {
    		panic(fmt.Sprintf("got = %v, want = %v", got, want))
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  9. src/cmd/internal/pkgpath/pkgpath_test.go

    	for _, test := range symbolTests {
    		if got, want := toSymbolV1(test.input), test.v1; got != want {
    			t.Errorf("toSymbolV1(%q) = %q, want %q", test.input, got, want)
    		}
    	}
    }
    
    func TestV2(t *testing.T) {
    	for _, test := range symbolTests {
    		if got, want := toSymbolV2(test.input), test.v2; got != want {
    			t.Errorf("toSymbolV2(%q) = %q, want %q", test.input, got, want)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 18:26:59 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/test/testdata/chan_test.go

    	v := make(chan int, 10)
    	v <- 1
    	v <- 1
    	v <- 1
    
    	if want, got := 3, lenChan_ssa(v); got != want {
    		t.Errorf("expected len(chan) = %d, got %d", want, got)
    	}
    }
    
    func testLenNilChan(t *testing.T) {
    
    	var v chan int
    	if want, got := 0, lenChan_ssa(v); got != want {
    		t.Errorf("expected len(nil) = %d, got %d", want, got)
    	}
    }
    
    func testCapChan(t *testing.T) {
    
    	v := make(chan int, 25)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 1.1K bytes
    - Viewed (0)
Back to top