Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 148 for testFS (0.15 sec)

  1. src/testing/fstest/testfs.go

    // The contents of fsys must not change concurrently with TestFS.
    //
    // If TestFS finds any misbehaviors, it returns either the first error or a
    // list of errors. Use [errors.Is] or [errors.As] to inspect.
    //
    // Typical usage inside a test is:
    //
    //	if err := fstest.TestFS(myFS, "file/that/should/be/present"); err != nil {
    //		t.Fatal(err)
    //	}
    func TestFS(fsys fs.FS, expected ...string) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  2. src/testing/fstest/testfs_test.go

    	if err := os.Symlink(filepath.Join(tmp, "hello"), filepath.Join(tmp, "hello.link")); err != nil {
    		t.Fatal(err)
    	}
    
    	if err := TestFS(tmpfs, "hello", "hello.link"); err != nil {
    		t.Fatal(err)
    	}
    }
    
    func TestDash(t *testing.T) {
    	m := MapFS{
    		"a-b/a": {Data: []byte("a-b/a")},
    	}
    	if err := TestFS(m, "a-b/a"); err != nil {
    		t.Error(err)
    	}
    }
    
    type shuffledFS MapFS
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  3. doc/next/6-stdlib/99-minor/testing/fstest/63675.md

    [TestFS] now returns a structured error that can be unwrapped
    (via method `Unwrap() []error`). This allows inspecting errors
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 12 20:57:18 UTC 2024
    - 159 bytes
    - Viewed (0)
  4. src/slices/sort_test.go

    	// should propagate the NaN to their output.
    	for i := 0; i < len(fs); i++ {
    		testfs := Clone(fs)
    		testfs[i] = math.NaN()
    
    		fmin := Min(testfs)
    		if !math.IsNaN(fmin) {
    			t.Errorf("got min %v, want NaN", fmin)
    		}
    
    		fmax := Max(testfs)
    		if !math.IsNaN(fmax) {
    			t.Errorf("got max %v, want NaN", fmax)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 19:20:55 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  5. src/testing/fstest/mapfs_test.go

    )
    
    func TestMapFS(t *testing.T) {
    	m := MapFS{
    		"hello":             {Data: []byte("hello, world\n")},
    		"fortune/k/ken.txt": {Data: []byte("If a program is too slow, it must have a loop.\n")},
    	}
    	if err := TestFS(m, "hello", "fortune", "fortune/k", "fortune/k/ken.txt"); err != nil {
    		t.Fatal(err)
    	}
    }
    
    func TestMapFSChmodDot(t *testing.T) {
    	m := MapFS{
    		"a/b.txt": &MapFile{Mode: 0666},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 14:59:55 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  6. src/io/fs/fs.go

    		}
    		w++
    	}
    	return string(buf[:w])
    }
    
    // IsDir reports whether m describes a directory.
    // That is, it tests for the [ModeDir] bit being set in m.
    func (m FileMode) IsDir() bool {
    	return m&ModeDir != 0
    }
    
    // IsRegular reports whether m describes a regular file.
    // That is, it tests that no mode type bits are set.
    func (m FileMode) IsRegular() bool {
    	return m&ModeType == 0
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 15 21:21:41 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  7. src/os/os_test.go

    	from, to := "renameFROM", "RENAMEfrom"
    	tests := []struct {
    		name   string
    		create func() error
    	}{
    		{"dir", func() error {
    			return Mkdir(from, 0777)
    		}},
    		{"file", func() error {
    			fd, err := Create(from)
    			if err != nil {
    				return err
    			}
    			return fd.Close()
    		}},
    	}
    
    	for _, test := range tests {
    		pt.Run(test.name, func(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 83.1K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/request/width_test.go

    			if test.initialSeatsExpected != workestimateGot.InitialSeats {
    				t.Errorf("Expected work estimate to match: %d initial seats, but got: %d", test.initialSeatsExpected, workestimateGot.InitialSeats)
    			}
    			if test.finalSeatsExpected != workestimateGot.FinalSeats {
    				t.Errorf("Expected work estimate to match: %d final seats, but got: %d", test.finalSeatsExpected, workestimateGot.FinalSeats)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 17K bytes
    - Viewed (0)
  9. pkg/volume/csi/csi_mounter_test.go

    	"k8s.io/kubernetes/pkg/volume/util"
    	volumetypes "k8s.io/kubernetes/pkg/volume/util/types"
    )
    
    var (
    	testDriver  = "test-driver"
    	testVol     = "vol-123"
    	testns      = "test-ns"
    	testPod     = "test-pod"
    	testPodUID  = types.UID("test-pod")
    	testAccount = "test-service-account"
    )
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 50.1K bytes
    - Viewed (0)
  10. platforms/software/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/ProjectDependencyResolveIntegrationTest.groovy

            then:
            executedAndNotSkipped ":b:jar", ":c:jar"
            resolve.expectGraph {
                root(":a", "test:a:") {
                    project(":b", "test:b:") {
                        project(":c", "test:c:") {
                            project(":a", "test:a:")
                        }
                    }
                }
            }
        }
    
        @NotYetImplemented
        @Issue('GRADLE-3280')
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 02 20:50:18 UTC 2024
    - 20.6K bytes
    - Viewed (0)
Back to top