summaryrefslogtreecommitdiff
path: root/internal/text/formatter_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-09-29 10:39:56 +0200
committerLibravatar GitHub <noreply@github.com>2023-09-29 10:39:56 +0200
commit536d9e482d4ebc012855372b9fcfa4f022d1618a (patch)
tree36079fb403b9a9bb7d3a64ace582c6870bcce77b /internal/text/formatter_test.go
parent[bugfix] Move follow.show_reblogs check further up to avoid showing unwanted ... (diff)
downloadgotosocial-536d9e482d4ebc012855372b9fcfa4f022d1618a.tar.xz
[chore/bugfix] Deinterface text.Formatter, allow underscores in hashtags (#2233)
Diffstat (limited to 'internal/text/formatter_test.go')
-rw-r--r--internal/text/formatter_test.go32
1 files changed, 25 insertions, 7 deletions
diff --git a/internal/text/formatter_test.go b/internal/text/formatter_test.go
index 403ba8e8e..cce9970b2 100644
--- a/internal/text/formatter_test.go
+++ b/internal/text/formatter_test.go
@@ -48,7 +48,7 @@ type TextStandardTestSuite struct {
testEmojis map[string]*gtsmodel.Emoji
// module being tested
- formatter text.Formatter
+ formatter *text.Formatter
}
func (suite *TextStandardTestSuite) SetupSuite() {
@@ -85,14 +85,32 @@ func (suite *TextStandardTestSuite) TearDownTest() {
testrig.StandardDBTeardown(suite.db)
}
-func (suite *TextStandardTestSuite) FromMarkdown(text string) *text.FormatResult {
- return suite.formatter.FromMarkdown(context.Background(), suite.parseMention, suite.testAccounts["local_account_1"].ID, "status_ID", text)
+func (suite *TextStandardTestSuite) FromMarkdown(input string) *text.FormatResult {
+ return suite.formatter.FromMarkdown(
+ context.Background(),
+ suite.parseMention,
+ suite.testAccounts["local_account_1"].ID,
+ "dummy_status_ID",
+ input,
+ )
}
-func (suite *TextStandardTestSuite) FromPlain(text string) *text.FormatResult {
- return suite.formatter.FromPlain(context.Background(), suite.parseMention, suite.testAccounts["local_account_1"].ID, "status_ID", text)
+func (suite *TextStandardTestSuite) FromPlain(input string) *text.FormatResult {
+ return suite.formatter.FromPlain(
+ context.Background(),
+ suite.parseMention,
+ suite.testAccounts["local_account_1"].ID,
+ "dummy_status_ID",
+ input,
+ )
}
-func (suite *TextStandardTestSuite) FromPlainNoParagraph(text string) *text.FormatResult {
- return suite.formatter.FromPlainNoParagraph(context.Background(), suite.parseMention, suite.testAccounts["local_account_1"].ID, "status_ID", text)
+func (suite *TextStandardTestSuite) FromPlainNoParagraph(input string) *text.FormatResult {
+ return suite.formatter.FromPlainNoParagraph(
+ context.Background(),
+ suite.parseMention,
+ suite.testAccounts["local_account_1"].ID,
+ "dummmy_status_ID",
+ input,
+ )
}