github.com/projectdiscovery/nuclei/v2@v2.9.15/pkg/templates/log_test.go (about)

     1  package templates
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func Test_appendAtSignToAuthors(t *testing.T) {
    10  	result := appendAtSignToAuthors([]string{"user1", "user2", "user3"})
    11  	assert.Equal(t, result, "@user1,@user2,@user3")
    12  }
    13  
    14  func Test_appendAtSignToMissingAuthors(t *testing.T) {
    15  	result := appendAtSignToAuthors([]string{})
    16  	assert.Equal(t, result, "@none")
    17  
    18  	result = appendAtSignToAuthors(nil)
    19  	assert.Equal(t, result, "@none")
    20  }
    21  
    22  func Test_appendAtSignToOneAuthor(t *testing.T) {
    23  	result := appendAtSignToAuthors([]string{"user1"})
    24  	assert.Equal(t, result, "@user1")
    25  }