mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
ffc931aad1
* Added unit tag as argument. Added description to runTests command. Changed code generator to have unit build tag in generated unit test files. * Added unit build tag to all unit test files. * added to new unit test unit build tag * Update verify-go.yml * small fix --------- Co-authored-by: Muhammadali Nazarov <Muhammadali.Nazarov@acronis.com> Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
35 lines
885 B
Go
35 lines
885 B
Go
//go:build unit
|
|
// +build unit
|
|
|
|
package piperutils
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestKeys(t *testing.T) {
|
|
intStringMap := map[int]string{1: "eins", 2: "zwei", 3: "drei", 4: "vier"}
|
|
|
|
intList := Keys(intStringMap)
|
|
|
|
assert.Equal(t, 4, len(intList))
|
|
assert.Equal(t, true, ContainsInt(intList, 1))
|
|
assert.Equal(t, true, ContainsInt(intList, 2))
|
|
assert.Equal(t, true, ContainsInt(intList, 3))
|
|
assert.Equal(t, true, ContainsInt(intList, 4))
|
|
}
|
|
|
|
func TestValues(t *testing.T) {
|
|
intStringMap := map[int]string{1: "eins", 2: "zwei", 3: "drei", 4: "vier"}
|
|
|
|
intList := Values(intStringMap)
|
|
|
|
assert.Equal(t, 4, len(intList))
|
|
assert.Equal(t, true, ContainsString(intList, "eins"))
|
|
assert.Equal(t, true, ContainsString(intList, "zwei"))
|
|
assert.Equal(t, true, ContainsString(intList, "drei"))
|
|
assert.Equal(t, true, ContainsString(intList, "vier"))
|
|
}
|