mirror of
https://github.com/facundoolano/jorge.git
synced 2024-12-26 21:58:51 +01:00
adb17ad9d2
* run linter in github actions * try fixing go mod * no install go * again * maybe this? * separate install * no v * fix lint errors
38 lines
755 B
Go
38 lines
755 B
Go
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 “Joe’s Garage” –by Frank Zappa…</p>
|
||
|
||
</body></html>`)
|
||
}
|