Skip to content

Commit

Permalink
Merge pull request #15 from ThiefMaster/tests
Browse files Browse the repository at this point in the history
Add tests for potential crashing issue
  • Loading branch information
coreyhulen committed Aug 1, 2018
2 parents 4064de6 + 9f49967 commit 22a7667
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions server/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestSpecialCases(t *testing.T) {
Pattern: "(Example)",
Template: "[Example](https://example.com)",
}, &Link{
Pattern: "(foobar)",
Pattern: "(foo!bar)",
Template: "fb",
})
validConfiguration := Configuration{links}
Expand Down Expand Up @@ -175,16 +175,24 @@ func TestSpecialCases(t *testing.T) {
"![ Mattermost ][1]\n\n[1]: https://mattermost.com/example.png",
},
{
"foobar\nExample\nfoobar Mattermost",
"foo!bar\nExample\nfoo!bar Mattermost",
"fb\n[Example](https://example.com)\nfb [Mattermost](https://mattermost.com)",
},
{
"foobar",
"foo!bar",
"fb",
},
{
"foobarfoobar",
"foobarfoobar",
"foo!barfoo!bar",
"foo!barfoo!bar",
},
{
"foo!bar & foo!bar",
"fb & fb",
},
{
"foo!bar & foo!bar\nfoo!bar & foo!bar\nfoo!bar & foo!bar",
"fb & fb\nfb & fb\nfb & fb",
},
}

Expand Down

0 comments on commit 22a7667

Please sign in to comment.