Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for Equals (0.19 sec)

  1. src/bytes/buffer_test.go

    			if allocs != 0 {
    				t.Errorf("allocation occurred during write")
    			}
    			// Check that buffer has correct data.
    			if !Equal(buf.Bytes()[0:startLen-readBytes], xBytes[readBytes:]) {
    				t.Errorf("bad initial data at %d %d", startLen, growLen)
    			}
    			if !Equal(buf.Bytes()[startLen-readBytes:startLen-readBytes+growLen], yBytes) {
    				t.Errorf("bad written data at %d %d", startLen, growLen)
    			}
    		}
    	}
    }
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  2. src/archive/tar/strconv_test.go

    			if v.ok {
    				t.Errorf("parsePAXTime(%q): got parsing failure, want success", v.in)
    			} else {
    				t.Errorf("parsePAXTime(%q): got parsing success, want failure", v.in)
    			}
    		}
    		if ok && !ts.Equal(v.want) {
    			t.Errorf("parsePAXTime(%q): got (%ds %dns), want (%ds %dns)",
    				v.in, ts.Unix(), ts.Nanosecond(), v.want.Unix(), v.want.Nanosecond())
    		}
    	}
    }
    
    func TestFormatPAXTime(t *testing.T) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 09 05:28:50 GMT 2021
    - 14K bytes
    - Viewed (0)
  3. src/archive/zip/writer_test.go

    	idx := bytes.Index(b, sig[:])
    	if idx == -1 {
    		t.Fatal("file header not found")
    	}
    	b = b[idx:]
    
    	if !bytes.Equal(b[6:10], []byte{0, 0, 0, 0}) { // FileHeader.Flags: 0, FileHeader.Method: 0
    		t.Errorf("unexpected method and flags: %v", b[6:10])
    	}
    
    	if !bytes.Equal(b[14:26], make([]byte, 12)) { // FileHeader.{CRC32,CompressSize,UncompressedSize} all zero.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 15 19:04:06 GMT 2023
    - 14.1K bytes
    - Viewed (0)
  4. src/bytes/example_test.go

    		// a less b
    	}
    	if bytes.Compare(a, b) <= 0 {
    		// a less or equal b
    	}
    	if bytes.Compare(a, b) > 0 {
    		// a greater b
    	}
    	if bytes.Compare(a, b) >= 0 {
    		// a greater or equal b
    	}
    
    	// Prefer Equal to Compare for equality comparisons.
    	if bytes.Equal(a, b) {
    		// a equal b
    	}
    	if !bytes.Equal(a, b) {
    		// a not equal b
    	}
    }
    
    func ExampleCompare_search() {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  5. src/cmd/asm/internal/arch/arch.go

    	instructions["JCS"] = x86.AJCS  /* carry set (CF = 1) */
    	instructions["JE"] = x86.AJEQ   /* alternate */
    	instructions["JEQ"] = x86.AJEQ  /* equal (ZF = 1) */
    	instructions["JG"] = x86.AJGT   /* alternate */
    	instructions["JGE"] = x86.AJGE  /* greater than or equal (signed) (SF = OF) */
    	instructions["JGT"] = x86.AJGT  /* greater than (signed) (ZF = 0 && SF = OF) */
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Mar 21 06:51:28 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  6. src/bytes/bytes.go

    // It is analogous to the facilities of the [strings] package.
    package bytes
    
    import (
    	"internal/bytealg"
    	"unicode"
    	"unicode/utf8"
    )
    
    // Equal reports whether a and b
    // are the same length and contain the same bytes.
    // A nil argument is equivalent to an empty slice.
    func Equal(a, b []byte) bool {
    	// Neither cmd/compile nor gccgo allocates for these string conversions.
    	return string(a) == string(b)
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  7. src/archive/zip/zip_test.go

    		}
    	}
    }
    
    func TestModTime(t *testing.T) {
    	var testTime = time.Date(2009, time.November, 10, 23, 45, 58, 0, time.UTC)
    	fh := new(FileHeader)
    	fh.SetModTime(testTime)
    	outTime := fh.ModTime()
    	if !outTime.Equal(testTime) {
    		t.Errorf("times don't match: got %s, want %s", outTime, testTime)
    	}
    }
    
    func testHeaderRoundTrip(fh *FileHeader, wantUncompressedSize uint32, wantUncompressedSize64 uint64, t *testing.T) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  8. src/builtin/builtin.go

    // argument, not a pointer to it. The specification of the result depends on
    // the type:
    //
    //	Slice: The size specifies the length. The capacity of the slice is
    //	equal to its length. A second integer argument may be provided to
    //	specify a different capacity; it must be no smaller than the
    //	length. For example, make([]int, 0, 10) allocates an underlying array
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  9. src/archive/tar/tar_test.go

    		t.Errorf("Mode = %#o; want %#o", g, e)
    	}
    	if g, e := h.Size, int64(5); g != e {
    		t.Errorf("Size = %v; want %v", g, e)
    	}
    	if g, e := h.ModTime, fi.ModTime(); !g.Equal(e) {
    		t.Errorf("ModTime = %v; want %v", g, e)
    	}
    	// FileInfoHeader should error when passing nil FileInfo
    	if _, err := FileInfoHeader(nil, ""); err == nil {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  10. src/archive/tar/reader.go

    		return nil, nil, err // EOF is okay here; exactly 0 bytes read
    	}
    	if bytes.Equal(tr.blk[:], zeroBlock[:]) {
    		if _, err := io.ReadFull(tr.r, tr.blk[:]); err != nil {
    			return nil, nil, err // EOF is okay here; exactly 1 block of zeros read
    		}
    		if bytes.Equal(tr.blk[:], zeroBlock[:]) {
    			return nil, nil, io.EOF // normal EOF; exactly 2 block of zeros read
    		}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
Back to top