gocal icon indicating copy to clipboard operation
gocal copied to clipboard

Added unescaping for newline

Open gelin opened this issue 5 years ago • 2 comments

gelin avatar Apr 19 '19 18:04 gelin

This would merged, but tests do not pass on my end, could you fix them?

--- FAIL: Test_Newline (0.00s)
    gocal_test.go:224: [{[email protected]  line1\nline2\Nline3 [] 2019-04-19 00:00:00 +0000 UTC 20190419 2019-04-18 23:59:59 +0000 UTC 20190419 2017-04-19 17:23:00 +0000 UTC <nil> <nil>  <nil>   <nil> [] [] false  map[] [] 0 map[]}]
    gocal_test.go:226:
                Error Trace:    gocal_test.go:226
                Error:          Not equal:
                                expected: "line1\nline2\nline3"
                                actual  : "line1\\nline2\\Nline3"

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,3 +1 @@
                                -line1
                                -line2
                                -line3
                                +line1\nline2\Nline3
                Test:           Test_Newline

apognu avatar Dec 31 '19 13:12 apognu

It looks like the test uses an old version of the parser. Wrong modules configuration?

Now I've merged the master to this pull request, and tests work:

$ go version
go version go1.13.5 linux/amd64
$ go test ./...
ok      github.com/apognu/gocal 0.004s
?       github.com/apognu/gocal/examples/custom [no test files]
?       github.com/apognu/gocal/examples/rrule  [no test files]
ok      github.com/apognu/gocal/parser  0.004s

gelin avatar Jan 03 '20 13:01 gelin