Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for tenRunes (0.36 sec)

  1. src/bytes/bytes_test.go

    	}
    	return r
    }
    
    func TestMap(t *testing.T) {
    	// Run a couple of awful growth/shrinkage tests
    	a := tenRunes('a')
    
    	// 1.  Grow. This triggers two reallocations in Map.
    	maxRune := func(r rune) rune { return unicode.MaxRune }
    	m := Map(maxRune, []byte(a))
    	expect := tenRunes(unicode.MaxRune)
    	if string(m) != expect {
    		t.Errorf("growing: expected %q got %q", expect, m)
    	}
    
    	// 2. Shrink
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top