Skip to content

Commit

Permalink
feat: support more input
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinaldy Rafli committed Oct 28, 2021
1 parent 0581376 commit 70b2bd0
Show file tree
Hide file tree
Showing 4 changed files with 369 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .github/codegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const fs = require('fs/promises');
// the letters array just to be a single value.
const letters =
[
`
__ _
/ _\` |
| (_| |
\\__,_|
`,
` _
(_)
| |
| |
|_|
`,
]

;(async () => {
Expand All @@ -26,5 +26,5 @@ const letters =
}
output += "}\n";
}
await fs.writeFile('./../generated.go', output, { encoding: 'utf-8' });
await fs.writeFile('./generated.go', output, { encoding: 'utf-8' });
})();
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The usage is pretty straight forward, on your Go file:

// or

output = asciitxt.WithConfig("Hello world", &asciitxt.Config{
output = asciitxt.WithConfig("Hello world", asciitxt.Config{
Style: asciitxt.StyleStandard,
})
}
Expand Down
12 changes: 10 additions & 2 deletions asciitxt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ import (
)

func TestNew(t *testing.T) {
s := asciitxt.New("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0123456789 _ the quick brown fox jumps over the lazy dog")
s := asciitxt.New("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0123456789 æ` the quick brown fox jumps over the lazy dog")

if s == "" {
t.Error("should not be empty")
}
}
func TestWithConfig(t *testing.T) {
s := asciitxt.WithConfig("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0123456789 _ the quick brown fox jumps over the lazy dog", asciitxt.Config{})
s := asciitxt.WithConfig("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0123456789 æ` the quick brown fox jumps over the lazy dog", asciitxt.Config{})

if s == "" {
t.Error("should not be empty")
}
}

func TestSymbols(t *testing.T) {
s := asciitxt.WithConfig(`!"#$%&'()*+,-./:;<=>?[\]^_{|}~¡¢£¥¨§©±`, asciitxt.Config{Style: asciitxt.StyleStandard})

if s == "" {
t.Error("should not be empty")
Expand Down
Loading

0 comments on commit 70b2bd0

Please sign in to comment.