focalboard/server/services/notify/notifysubscriptions/diff2markdown_test.go
Doug Lauder 72bf464b22
Improved diff to markdown for card notifications (#2037)
* improved text diff for notifications

* fix panic selecting insert_at

* improvements wip

* simplified v1

* improved diff to markdown

* address review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-05 14:11:58 -07:00

26 lines
645 B
Go

package notifysubscriptions
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_reverse(t *testing.T) {
tests := []struct {
name string
ss []string
want []string
}{
{name: "even", ss: []string{"one", "two", "three", "four"}, want: []string{"four", "three", "two", "one"}},
{name: "odd", ss: []string{"one", "two", "three"}, want: []string{"three", "two", "one"}},
{name: "one", ss: []string{"one"}, want: []string{"one"}},
{name: "empty", ss: []string{}, want: []string{}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
reverse(tt.ss)
assert.Equal(t, tt.want, tt.ss)
})
}
}