compile_inp_test.go 2.15 KB
Newer Older
Ma_124's avatar
Ma_124 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
package awesomefw

import (
	"testing"
	"github.com/stretchr/testify/assert"
	"strings"
)

var awesomeAwesomeShortOut = `
"# Awesome Awesome
"
"A curated list of awesome curated lists of many topics.
"
"- [Awesome Awesome](#awesome-awesome)
"    - [Computer management](#computer-management)
"## Computer management
"
awesome-scalability	https://github.com/binhnguyennus/awesome-scalability	An up-to-date and curated reading list for designing high scalability, high availability, high stabilityback-end systems.
awesome-shell	https://github.com/alebcay/awesome-shell	Command-line frameworks, toolkits, guides and gizmos.
awesome-sysadmin	https://github.com/kahun/awesome-sysadmin	Backups, configuration management, DNS, IMAP/POP3, LDAP, monitoring, SSH, statistics, troubleshooting, virtualization, VPN and more.
"
"For contributing, [open an issue](https://github.com/emijrp/awesome-awesome/issues) and/or a [pull request](https://github.com/emijrp/awesome-awesome/pulls). Above there are some ideas for missing lists, be bold!
`[1:]

func TestCompile_MarkdownTabSep(t *testing.T) {
	out := &strings.Builder{}
	in := `
# Awesome Awesome

A curated list of awesome curated lists of many topics.

- [Awesome Awesome](#awesome-awesome)
    - [Computer management](#computer-management)
## Computer management

* [awesome-scalability](https://github.com/binhnguyennus/awesome-scalability) - An up-to-date and curated reading list for designing high scalability, high availability, high stabilityback-end systems.
* [awesome-shell](https://github.com/alebcay/awesome-shell) - Command-line frameworks, toolkits, guides and gizmos.
* [awesome-sysadmin](https://github.com/kahun/awesome-sysadmin) - Backups, configuration management, DNS, IMAP/POP3, LDAP, monitoring, SSH, statistics, troubleshooting, virtualization, VPN and more.

For contributing, [open an issue](https://github.com/emijrp/awesome-awesome/issues) and/or a [pull request](https://github.com/emijrp/awesome-awesome/pulls). Above there are some ideas for missing lists, be bold!
`[1:]
42
	Compile(strings.NewReader(in), len(in), out, IFFMarkdown, OFFTabSep, &ApisCfg{&ApiCfg{}})
Ma_124's avatar
Ma_124 committed
43 44 45

	t.Log(assert.Equal(t, awesomeAwesomeShortOut, out.String()))
}