Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for TestReadFile (0.16 sec)

  1. src/io/fs/readfile_test.go

    	},
    }
    
    var sysValue int
    
    type readFileOnly struct{ ReadFileFS }
    
    func (readFileOnly) Open(name string) (File, error) { return nil, ErrNotExist }
    
    type openOnly struct{ FS }
    
    func TestReadFile(t *testing.T) {
    	// Test that ReadFile uses the method when present.
    	data, err := ReadFile(readFileOnly{testFsys}, "hello.txt")
    	if string(data) != "hello, world" || err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 16:25:41 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  2. src/io/ioutil/ioutil_test.go

    	if err != nil {
    		t.Fatalf("Stat %q (looking for size %d): %s", path, size, err)
    	}
    	if dir.Size() != size {
    		t.Errorf("Stat %q: size %d want %d", path, dir.Size(), size)
    	}
    }
    
    func TestReadFile(t *testing.T) {
    	filename := "rumpelstilzchen"
    	contents, err := ReadFile(filename)
    	if err == nil {
    		t.Fatalf("ReadFile %s: error expected, none found", filename)
    	}
    
    	filename = "ioutil_test.go"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  3. src/os/read_test.go

    	dir, err := Stat(path)
    	if err != nil {
    		t.Fatalf("Stat %q (looking for size %d): %s", path, size, err)
    	}
    	if dir.Size() != size {
    		t.Errorf("Stat %q: size %d want %d", path, dir.Size(), size)
    	}
    }
    
    func TestReadFile(t *testing.T) {
    	t.Parallel()
    
    	filename := "rumpelstilzchen"
    	contents, err := ReadFile(filename)
    	if err == nil {
    		t.Fatalf("ReadFile %s: error expected, none found", filename)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 02:36:46 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  4. src/debug/buildinfo/buildinfo_test.go

    // TestReadFile confirms that ReadFile can read build information from binaries
    // on supported target platforms. It builds a trivial binary on the current
    // platforms (or all platforms if -all is set) in various configurations and
    // checks that build information can or cannot be read.
    func TestReadFile(t *testing.T) {
    	if testing.Short() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 22 16:22:42 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  5. src/cmd/internal/buildid/buildid_test.go

    	expectedID = "abcdefghijklmnopqrstuvwxyz.1234567890123456789012345678901234567890123456789012345678901234"
    	newID      = "bcdefghijklmnopqrstuvwxyza.2345678901234567890123456789012345678901234567890123456789012341"
    )
    
    func TestReadFile(t *testing.T) {
    	f, err := os.CreateTemp("", "buildid-test-")
    	if err != nil {
    		t.Fatal(err)
    	}
    	tmp := f.Name()
    	defer os.Remove(tmp)
    	f.Close()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:28 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  6. src/cmd/go/internal/modfetch/codehost/git_test.go

    			info := *tt.info
    			tt.info = &info
    			o := *info.Origin
    			info.Origin = &o
    			o.URL = localGitURL(t)
    			t.Run(path.Base(tt.repo), runTest(tt))
    		}
    	}
    }
    
    func TestReadFile(t *testing.T) {
    	t.Parallel()
    
    	type readFileTest struct {
    		repo string
    		rev  string
    		file string
    		err  string
    		data string
    	}
    	runTest := func(tt readFileTest) func(*testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 19:46:23 UTC 2023
    - 18.9K bytes
    - Viewed (0)
  7. tensorflow/c/experimental/filesystem/modular_filesystem_test.cc

      std::unique_ptr<WritableFile> same_file;
      status = env_->NewAppendableFile(new_path, &same_file);
      EXPECT_PRED2(UnimplementedOrReturnsCode, status, Code::FAILED_PRECONDITION);
    }
    
    TEST_P(ModularFileSystemTest, TestReadFile) {
      const std::string filepath = GetURIForPath("a_file");
      std::unique_ptr<RandomAccessFile> new_file;
      Status status = env_->NewRandomAccessFile(filepath, &new_file);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 27 20:25:58 UTC 2022
    - 71K bytes
    - Viewed (0)
Back to top