Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1083)

Delta Between Two Patch Sets: src/pkg/os/os_test.go

Issue 4357052: code review 4357052: os: New Open API. (Closed)
Left Patch Set: Created 12 years, 12 months ago
Right Patch Set: diff -r dc1d5042801a https://go.googlecode.com/hg/ Created 12 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package os_test 5 package os_test
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "io" 10 "io"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 data, err := ioutil.ReadFile(fname) 858 data, err := ioutil.ReadFile(fname)
859 if err != nil { 859 if err != nil {
860 t.Fatalf("ReadFile: %v", err) 860 t.Fatalf("ReadFile: %v", err)
861 } 861 }
862 return string(data) 862 return string(data)
863 } 863 }
864 864
865 func TestAppend(t *testing.T) { 865 func TestAppend(t *testing.T) {
866 const f = "append.txt" 866 const f = "append.txt"
867 defer Remove(f) 867 defer Remove(f)
868 » s := writeFile(t, f, O_CREAT|O_TRUNC|O_RDWR, "new") 868 » s := writeFile(t, f, O_CREATE|O_TRUNC|O_RDWR, "new")
869 if s != "new" { 869 if s != "new" {
870 t.Fatalf("writeFile: have %q want %q", s, "new") 870 t.Fatalf("writeFile: have %q want %q", s, "new")
871 } 871 }
872 s = writeFile(t, f, O_APPEND|O_RDWR, "|append") 872 s = writeFile(t, f, O_APPEND|O_RDWR, "|append")
873 if s != "new|append" { 873 if s != "new|append" {
874 t.Fatalf("writeFile: have %q want %q", s, "new|append") 874 t.Fatalf("writeFile: have %q want %q", s, "new|append")
875 } 875 }
876 } 876 }
877 877
878 func TestStatDirWithTrailingSlash(t *testing.T) { 878 func TestStatDirWithTrailingSlash(t *testing.T) {
(...skipping 11 matching lines...) Expand all
890 if err != nil { 890 if err != nil {
891 t.Fatal("stat failed:", err) 891 t.Fatal("stat failed:", err)
892 } 892 }
893 893
894 // Stat of path+"/" should succeed too. 894 // Stat of path+"/" should succeed too.
895 _, err = Stat(path + "/") 895 _, err = Stat(path + "/")
896 if err != nil { 896 if err != nil {
897 t.Fatal("stat failed:", err) 897 t.Fatal("stat failed:", err)
898 } 898 }
899 } 899 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b