Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TestBytes (0.08 sec)

  1. src/bytes/buffer_test.go

    var testString string // test data for write tests
    var testBytes []byte  // test data; same as testString but as a slice.
    
    type negativeReader struct{}
    
    func (r *negativeReader) Read([]byte) (int, error) { return -1, nil }
    
    func init() {
    	testBytes = make([]byte, N)
    	for i := 0; i < N; i++ {
    		testBytes[i] = 'a' + byte(i%26)
    	}
    	testString = string(testBytes)
    }
    
    // Verify that contents of buf match the string s.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:31:36 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/base/Utf8Test.java

      @GwtIncompatible // java.nio.charset.Charset
      public void testIsWellFormed_1Byte() {
        testBytes(1, EXPECTED_ONE_BYTE_ROUNDTRIPPABLE_COUNT);
      }
    
      /** Tests that round tripping of all two byte permutations work. */
      @GwtIncompatible // java.nio.charset.Charset
      public void testIsWellFormed_2Bytes() {
        testBytes(2, EXPECTED_TWO_BYTE_ROUNDTRIPPABLE_COUNT);
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Feb 09 15:49:48 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  3. src/go/constant/value_test.go

    		}
    	}
    }
    
    var bytesTests = []string{
    	"0",
    	"1",
    	"123456789",
    	"123456789012345678901234567890123456789012345678901234567890",
    }
    
    func TestBytes(t *testing.T) {
    	for _, test := range bytesTests {
    		x := val(test)
    		bytes := Bytes(x)
    
    		// special case 0
    		if Sign(x) == 0 && len(bytes) != 0 {
    			t.Errorf("%s: got %v; want empty byte slice", test, bytes)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 15.6K bytes
    - Viewed (0)
Back to top