parser_common_test.go 449 B

1234567891011121314151617
  1. package common
  2. import (
  3. "github.com/stretchr/testify/assert"
  4. "testing"
  5. )
  6. func TestGetEmails(t *testing.T) {
  7. str := `a@naver.com aaaaaaaaaaaaaaaaaaaaaaaaaa ddddddddddddddddd
  8. dddddddddddddddddd fjskjkfjdkl 하너ㅏㅇ러ㅏ어라ㅓ망 ㄹ어낭러ㅏㄹ
  9. a_a@gmail.com 러아라ㅓㅏ어ㅏㄹ
  10. a123@daum.net`
  11. //str = "aaa@gmail.com"
  12. ss := GetEmails(str)
  13. assert.EqualValues(t, []string{"a@naver.com", "a_a@gmail.com", "a123@daum.net"}, ss)
  14. }