Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for TestChan (0.14 sec)

  1. src/cmd/compile/internal/test/testdata/chan_test.go

    	}
    }
    
    func testCapNilChan(t *testing.T) {
    
    	var v chan int
    	if want, got := 0, capChan_ssa(v); got != want {
    		t.Errorf("expected cap(nil) = %d, got %d", want, got)
    	}
    }
    
    func TestChan(t *testing.T) {
    	testLenChan(t)
    	testLenNilChan(t)
    
    	testCapChan(t)
    	testCapNilChan(t)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 1.1K bytes
    - Viewed (0)
  2. test/range.go

    		panic("fail")
    	}
    }
    
    func testchan() {
    	s := ""
    	for i := range seq('a', 'z') {
    		s += string(i)
    	}
    	if s != alphabet {
    		println("Wanted lowercase alphabet; got", s)
    		panic("fail")
    	}
    	n := 0
    	for range seq('a', 'z') {
    		n++
    	}
    	if n != 26 {
    		println("testchan wrong count", n, "want 26")
    		panic("fail")
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 05:50:54 UTC 2017
    - 8.1K bytes
    - Viewed (0)
  3. src/time/tick_test.go

    	run(t, "NewTicker", func() { NewTicker(Hour) })
    	run(t, "NewTimerStop", func() { NewTimer(Hour).Stop() })
    	run(t, "NewTickerStop", func() { NewTicker(Hour).Stop() })
    }
    
    func TestChan(t *testing.T) {
    	for _, name := range []string{"0", "1", "2"} {
    		t.Run("asynctimerchan="+name, func(t *testing.T) {
    			t.Setenv("GODEBUG", "asynctimerchan="+name)
    			t.Run("Timer", func(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 17:10:37 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  4. src/runtime/chan_test.go

    // license that can be found in the LICENSE file.
    
    package runtime_test
    
    import (
    	"internal/testenv"
    	"math"
    	"runtime"
    	"sync"
    	"sync/atomic"
    	"testing"
    	"time"
    )
    
    func TestChan(t *testing.T) {
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
    	N := 200
    	if testing.Short() {
    		N = 20
    	}
    	for chanCap := 0; chanCap < N; chanCap++ {
    		{
    			// Ensure that receive from empty chan blocks.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 20:47:35 UTC 2023
    - 23.4K bytes
    - Viewed (0)
  5. src/reflect/all_test.go

    		t.Errorf("mbig.MapIndex(\"hello\") for nil map = %v, want Invalid Value", x)
    	}
    
    	// Test that deletes from a nil map succeed.
    	mv.SetMapIndex(ValueOf("hi"), Value{})
    }
    
    func TestChan(t *testing.T) {
    	for loop := 0; loop < 2; loop++ {
    		var c chan int
    		var cv Value
    
    		// check both ways to allocate channels
    		switch loop {
    		case 1:
    			c = make(chan int, 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top