1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-15 11:19:11 +00:00

*: initial thoughts

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-03-10 16:15:55 -05:00
commit 16b15e1c29
4 changed files with 334 additions and 0 deletions

41
mtree_test.go Normal file
View file

@ -0,0 +1,41 @@
package mtree
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"testing"
)
var testFiles = []string{
"testdata/source.mtree",
}
func TestParser(t *testing.T) {
for _, file := range testFiles {
func() {
fh, err := os.Open(file)
if err != nil {
log.Println(err)
return
}
defer fh.Close()
s := bufio.NewScanner(fh)
for s.Scan() {
str := s.Text()
switch {
case strings.HasPrefix(str, "#"):
continue
default:
}
fmt.Printf("%q\n", str)
}
if err := s.Err(); err != nil {
log.Println("ERROR:", err)
}
}()
}
}