Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
b4b3f6a0
Unverified
Commit
b4b3f6a0
authored
Oct 02, 2020
by
Matheus Alcantara
Committed by
GitHub
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test: Create unit test to SplitEmails (#27985)
parent
a28a2fba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
pkg/util/split_email_test.go
+52
-0
No files found.
pkg/util/split_email_test.go
0 → 100644
View file @
b4b3f6a0
package
util
import
(
"testing"
"github.com/stretchr/testify/assert"
)
func
TestSplitEmails
(
t
*
testing
.
T
)
{
testcases
:=
[]
struct
{
input
string
expected
[]
string
}{
{
input
:
""
,
expected
:
[]
string
{},
},
{
input
:
"ops@grafana.org"
,
expected
:
[]
string
{
"ops@grafana.org"
},
},
{
input
:
"ops@grafana.org;dev@grafana.org"
,
expected
:
[]
string
{
"ops@grafana.org"
,
"dev@grafana.org"
},
},
{
input
:
"ops@grafana.org;dev@grafana.org,"
,
expected
:
[]
string
{
"ops@grafana.org"
,
"dev@grafana.org"
},
},
{
input
:
"dev@grafana.org,ops@grafana.org"
,
expected
:
[]
string
{
"dev@grafana.org"
,
"ops@grafana.org"
},
},
{
input
:
"dev@grafana.org,ops@grafana.org,"
,
expected
:
[]
string
{
"dev@grafana.org"
,
"ops@grafana.org"
},
},
{
input
:
"dev@grafana.org
\n
ops@grafana.org"
,
expected
:
[]
string
{
"dev@grafana.org"
,
"ops@grafana.org"
},
},
{
input
:
"dev@grafana.org
\n
ops@grafana.org
\n
"
,
expected
:
[]
string
{
"dev@grafana.org"
,
"ops@grafana.org"
},
},
}
for
_
,
tt
:=
range
testcases
{
emails
:=
SplitEmails
(
tt
.
input
)
assert
.
Equal
(
t
,
tt
.
expected
,
emails
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment