1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/pkg/piperutils/slices_test.go
Sven Merk cbe368fe36
Checkmarx as golang (#1075)
* Added base functionality for checkmarx interaction

* Extend http client with file upload capabilities

* Latest changes

* Add debug logging

* Introduce Uploader interface

* Add tests for checkmarx client

* Hook new checkmarx command

* Improve coverage

* Add tests

* Improved test coverage and fixed code

* Add influx reporting

* Add alternation capabilities

* Add groovy step

* Try fix cmd

* Enhancements

* Fix report generation

* Final performance improvements

* Fix code

* Structure code, cleanup

* Improvements

* Fix codeclimate issue

* Update groovy

* Adapt latest changes to http

* Fix test

* Fix http tests

* Fix test

* Fix test

* Fix test 2

* Fix code

* Fix code 2

* Fix code

* Code

* Fix

* Fix

* Add report and link handling

* Fix returns, add groovy test

* Review comments

* Added doc template

* Docs update

* Remove SAP internals

* Better status display

* Add name to link

* Fix test

* Fix

* Fix verbose handling

* Fix verbose handling 2

* Fix verbose handling 3

* Fix

* Tiny improvements

* Regenerate

* Fix test

* Fix test code

* Fix verbosity issue

* Fix test

* Fix test

* Fix test
2020-01-27 23:40:53 +01:00

18 lines
613 B
Go

package piperutils
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestContainsInt(t *testing.T) {
var intList []int
assert.Equal(t, false, ContainsInt(intList, 4), "False expected but returned true")
intList = append(intList, 1, 2, 3, 4, 5, 6, 20)
assert.Equal(t, true, ContainsInt(intList, 20), "True expected but returned false")
assert.Equal(t, true, ContainsInt(intList, 1), "True expected but returned false")
assert.Equal(t, true, ContainsInt(intList, 4), "True expected but returned false")
assert.Equal(t, false, ContainsInt(intList, 13), "False expected but returned true")
}