You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

processorhelper_test.go 571B

1234567891011121314151617181920
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package markup
  5. import (
  6. "context"
  7. "testing"
  8. "code.gitea.io/gitea/models/unittest"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestProcessorHelper(t *testing.T) {
  12. assert.NoError(t, unittest.PrepareTestDatabase())
  13. assert.True(t, ProcessorHelper().IsUsernameMentionable(context.Background(), "user10"))
  14. assert.False(t, ProcessorHelper().IsUsernameMentionable(context.Background(), "no-such-user"))
  15. }