Black Lives Matter. Support the Equal Justice Initiative.

Source file src/testing/fstest/mapfs_test.go

Documentation: testing/fstest

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package fstest
     6  
     7  import (
     8  	"testing"
     9  )
    10  
    11  func TestMapFS(t *testing.T) {
    12  	m := MapFS{
    13  		"hello":             {Data: []byte("hello, world\n")},
    14  		"fortune/k/ken.txt": {Data: []byte("If a program is too slow, it must have a loop.\n")},
    15  	}
    16  	if err := TestFS(m, "hello", "fortune/k/ken.txt"); err != nil {
    17  		t.Fatal(err)
    18  	}
    19  }
    20  

View as plain text