Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for copyTest (0.24 sec)

  1. pkg/file/file_test.go

    	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")
    	data := []byte("hello world")
    	err := AtomicWrite(file, data, 0o750)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Dec 11 19:10:54 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  2. src/make.bat

    if x%2==x-no-clean...
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 22:16:54 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  3. src/text/template/parse/node.go

    	for _, n := range l.Nodes {
    		n.writeTo(sb)
    	}
    }
    
    func (l *ListNode) CopyList() *ListNode {
    	if l == nil {
    		return l
    	}
    	n := l.tr.newList(l.Pos)
    	for _, elem := range l.Nodes {
    		n.append(elem.Copy())
    	}
    	return n
    }
    
    func (l *ListNode) Copy() Node {
    	return l.CopyList()
    }
    
    // TextNode holds plain text.
    type TextNode struct {
    	NodeType
    	Pos
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  4. src/compress/flate/inflate.go

    			f.err = CorruptInputError(f.roffset)
    			return
    		}
    
    		f.copyLen, f.copyDist = length, dist
    		goto copyHistory
    	}
    
    copyHistory:
    	// Perform a backwards copy according to RFC section 3.2.3.
    	{
    		cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen)
    		if cnt == 0 {
    			cnt = f.dict.writeCopy(f.copyDist, f.copyLen)
    		}
    		f.copyLen -= cnt
    
    		if f.dict.availWrite() == 0 || f.copyLen > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 23:20:03 UTC 2023
    - 20.4K bytes
    - Viewed (0)
  5. src/syscall/js/js_test.go

    		err := recover()
    		if err == nil {
    			t.Errorf("expected panic")
    		}
    	}()
    	fn()
    }
    
    var copyTests = []struct {
    	srcLen  int
    	dstLen  int
    	copyLen int
    }{
    	{5, 3, 3},
    	{3, 5, 3},
    	{0, 0, 0},
    }
    
    func TestCopyBytesToGo(t *testing.T) {
    	for _, tt := range copyTests {
    		t.Run(fmt.Sprintf("%d-to-%d", tt.srcLen, tt.dstLen), func(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 14:35:26 UTC 2024
    - 17.7K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modcmd/vendor.go

    // to nudge people toward more agreement on the naming
    // and also trying to avoid false positives.
    var metaPrefixes = []string{
    	"AUTHORS",
    	"CONTRIBUTORS",
    	"COPYLEFT",
    	"COPYING",
    	"COPYRIGHT",
    	"LEGAL",
    	"LICENSE",
    	"NOTICE",
    	"PATENTS",
    }
    
    // matchMetadata reports whether info is a metadata file.
    func matchMetadata(dir string, info fs.DirEntry) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 14:19:59 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  7. src/text/template/parse/parse.go

    // Copy returns a copy of the [Tree]. Any parsing state is discarded.
    func (t *Tree) Copy() *Tree {
    	if t == nil {
    		return nil
    	}
    	return &Tree{
    		Name:      t.Name,
    		ParseName: t.ParseName,
    		Root:      t.Root.CopyList(),
    		text:      t.text,
    	}
    }
    
    // Parse returns a map from template name to [Tree], created by parsing the
    // templates described in the argument string. The top-level template will be
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 21.3K bytes
    - Viewed (0)
  8. src/html/template/escape.go

    		// with different top level templates, or clone if necessary.
    		dt := e.template(dname)
    		if dt == nil {
    			dt = template.New(dname)
    			dt.Tree = &parse.Tree{Name: dname, Root: t.Root.CopyList()}
    			e.derived[dname] = dt
    		}
    		t = dt
    	}
    	return e.computeOutCtx(c, t), dname
    }
    
    // computeOutCtx takes a template and its start context and computes the output
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 02 15:18:39 UTC 2023
    - 32.4K bytes
    - Viewed (0)
  9. CREDITS

     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.
    
                                Preamble
    
      The GNU Affero General Public License is a free, copyleft license for
    software and other kinds of works, specifically designed to ensure
    cooperation with the community in the case of network server software.
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jun 13 15:34:20 UTC 2024
    - 1.7M bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*IdentifierNode).SetTree", Method, 4},
    		{"(*IdentifierNode).String", Method, 0},
    		{"(*IfNode).Copy", Method, 0},
    		{"(*IfNode).String", Method, 0},
    		{"(*ListNode).Copy", Method, 0},
    		{"(*ListNode).CopyList", Method, 0},
    		{"(*ListNode).String", Method, 0},
    		{"(*NilNode).Copy", Method, 1},
    		{"(*NilNode).String", Method, 1},
    		{"(*NilNode).Type", Method, 1},
    		{"(*NumberNode).Copy", Method, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top