mirror of
https://github.com/jimeh/rbheap.git
synced 2026-02-19 12:56:46 +00:00
Add basic tests for DiffSect function
This commit is contained in:
34
diffsect_test.go
Normal file
34
diffsect_test.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDiffSect(t *testing.T) {
|
||||
tests := []struct {
|
||||
a []string
|
||||
b []string
|
||||
c []string
|
||||
result []string
|
||||
}{
|
||||
{
|
||||
a: []string{"1", "2", "3"},
|
||||
b: []string{"1", "2", "3", "4", "5", "6"},
|
||||
c: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9"},
|
||||
result: []string{"4", "5", "6"},
|
||||
},
|
||||
{
|
||||
a: []string{"1", "2", "3"},
|
||||
b: []string{"1", "2", "4", "5", "6"},
|
||||
c: []string{"1", "5", "6", "7", "8", "9"},
|
||||
result: []string{"5", "6"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, pair := range tests {
|
||||
result := DiffSect(&pair.a, &pair.b, &pair.c)
|
||||
assert.Equal(t, *result, pair.result)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user