Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TestCopy (0.25 sec)

  1. src/cmd/compile/internal/test/testdata/gen/copyGen.go

    		fmt.Fprintf(w, "  }\n")
    		fmt.Fprintf(w, "}\n")
    	}
    
    	// boilerplate at end
    	fmt.Fprintf(w, "func TestCopy(t *testing.T) {\n")
    	for _, s := range sizes {
    		fmt.Fprintf(w, "  testCopy%d(t)\n", s)
    	}
    	for _, s := range usizes {
    		fmt.Fprintf(w, "  testUnalignedCopy%d(t)\n", s)
    	}
    	fmt.Fprintf(w, "}\n")
    
    	// gofmt result
    	b := w.Bytes()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  2. pkg/file/file_test.go

    	}
    	m, _ := f.Stat()
    	// Mode should be copied
    	assert.Equal(t, m.Mode(), 0o750)
    
    	body, _ := io.ReadAll(f)
    	// Contents should be copied
    	assert.Equal(t, body, []byte("hello world"))
    }
    
    func TestCopy(t *testing.T) {
    	copyTest(t, Copy)
    }
    
    func TestAtomicCopy(t *testing.T) {
    	copyTest(t, AtomicCopy)
    }
    
    func TestAtomicWrite(t *testing.T) {
    	d := t.TempDir()
    	file := filepath.Join(d, "test")
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Dec 11 19:10:54 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  3. src/maps/maps_test.go

    	}
    }
    
    func TestCloneNil(t *testing.T) {
    	var m1 map[string]int
    	mc := Clone(m1)
    	if mc != nil {
    		t.Errorf("Clone(%v) = %v, want %v", m1, mc, m1)
    	}
    }
    
    func TestCopy(t *testing.T) {
    	mc := Clone(m1)
    	Copy(mc, mc)
    	if !Equal(mc, m1) {
    		t.Errorf("Copy(%v, %v) = %v, want %v", m1, m1, mc, m1)
    	}
    	Copy(mc, map[int]int{16: 32})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 17:05:56 UTC 2023
    - 5.6K bytes
    - Viewed (0)
Back to top