Skip to content

Commit

Permalink
devops: test public FormatByteSlice instead of internal
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Kungla <[email protected]>
  • Loading branch information
mkungla committed Nov 21, 2023
1 parent eee4f8a commit 740a558
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nfcsdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ package nfcsdk_test
import (
"testing"

"github.com/happy-sdk/nfcsdk/internal/helpers"
"github.com/happy-sdk/nfcsdk"
)

func TestFormatByteSlice(t *testing.T) {
// Test case 1: An empty byte slice should return an empty string.
emptySlice := []byte{}
result := helpers.FormatByteSlice(emptySlice)
result := nfcsdk.FormatByteSlice(emptySlice)
expected := ""
if result != expected {
t.Errorf("Expected '%s', but got '%s'", expected, result)
}

// Test case 2: A byte slice with some data should be formatted as expected.
dataSlice := []byte{72, 101, 108, 108, 111} // ASCII values for "Hello"
result = helpers.FormatByteSlice(dataSlice)
result = nfcsdk.FormatByteSlice(dataSlice)
expected = "48:65:6C:6C:6F" // Hexadecimal representation of ASCII values
if result != expected {
t.Errorf("Expected '%s', but got '%s'", expected, result)
Expand Down

0 comments on commit 740a558

Please sign in to comment.