jorge/markup/smartify_test.go
Facundo Olano adb17ad9d2
run linter in github actions (#20)
* run linter in github actions

* try fixing go mod

* no install go

* again

* maybe this?

* separate install

* no v

* fix lint errors
2024-02-29 19:34:33 -03:00

38 lines
755 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package markup
import (
"io"
"strings"
"testing"
)
func TestSmartify(t *testing.T) {
input := `<html>
<head>
<script type="text/javascript">
const url = 'http://localhost:4001/_events/';
const string = "joe's garage";
</script>
</head>
<body>
<p>the album is "Joe's Garage" --by Frank Zappa...</p>
</body>
</html>`
output, err := Smartify(".html", strings.NewReader(input))
assertEqual(t, err, nil)
buf := new(strings.Builder)
_, err = io.Copy(buf, output)
assertEqual(t, err, nil)
assertEqual(t, buf.String(), `<html><head>
<script type="text/javascript">
const url = 'http://localhost:4001/_events/';
const string = "joe's garage";
</script>
</head>
<body>
<p>the album is “Joes Garage” by Frank Zappa…</p>
</body></html>`)
}