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.

generate_test.go 459B

123456789101112131415161718192021222324
  1. // Copyright 2020 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 generate
  5. import (
  6. "os"
  7. "testing"
  8. "github.com/stretchr/testify/assert"
  9. )
  10. func TestMain(m *testing.M) {
  11. retVal := m.Run()
  12. os.Exit(retVal)
  13. }
  14. func TestGetRandomString(t *testing.T) {
  15. randomString, err := GetRandomString(4)
  16. assert.NoError(t, err)
  17. assert.Len(t, randomString, 4)
  18. }