github.com/d0sbit/gocode@v0.0.0-20211001144653-a968ce917518/cmd/gocode_mongocrud/diff_test.go (about)

     1  package main
     2  
     3  // import (
     4  // 	"testing"
     5  
     6  // 	"github.com/psanford/memfs"
     7  // )
     8  
     9  // func TestRunDiff(t *testing.T) {
    10  
    11  // 	in := memfs.New()
    12  // 	out := memfs.New()
    13  
    14  // 	must(t, in.MkdirAll("a", 0755))
    15  // 	must(t, in.WriteFile("a/test1.go", []byte("package a\n"), 0644))
    16  // 	must(t, in.WriteFile("a/test2.go", []byte("package a\nfunc b(){\n}\n"), 0644))
    17  
    18  // 	must(t, out.MkdirAll("a", 0755))
    19  // 	must(t, out.WriteFile("a/test2.go", []byte("package a\nfunc b(){\n}\n\nfunc c(){\n}\n"), 0644))
    20  // 	must(t, out.WriteFile("a/test3.go", []byte("package a\n"), 0644))
    21  
    22  // 	m, err := runDiff(in, out, "a", "html")
    23  // 	must(t, err)
    24  
    25  // 	t.Logf("m: %#v", m)
    26  
    27  // 	if len(m) != 2 {
    28  // 		t.Errorf("unexpected len(m): %d", len(m))
    29  // 	}
    30  
    31  // }