aboutsummaryrefslogtreecommitdiff
path: root/hotline/util_test.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-07-09 21:36:27 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-07-09 21:42:05 -0700
commitd9bc63a10d0978d9a5222cf7be74044e55f409b7 (patch)
tree1797c9593c279bf1334ed8285de8054a92a28dcb /hotline/util_test.go
parent8fa166777cbcd92e871e937d9557f0f1a732c04d (diff)
Extensive refactor and clean up
Diffstat (limited to 'hotline/util_test.go')
-rw-r--r--hotline/util_test.go47
1 files changed, 0 insertions, 47 deletions
diff --git a/hotline/util_test.go b/hotline/util_test.go
deleted file mode 100644
index 30ae2b6..0000000
--- a/hotline/util_test.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package hotline
-
-import (
- "fmt"
- "github.com/stretchr/testify/assert"
- "testing"
-)
-
-func Test_byteToInt(t *testing.T) {
- type args struct {
- bytes []byte
- }
- tests := []struct {
- name string
- args args
- want int
- wantErr assert.ErrorAssertionFunc
- }{
- {
- name: "with 2 bytes of input",
- args: args{bytes: []byte{0, 1}},
- want: 1,
- wantErr: assert.NoError,
- },
- {
- name: "with 4 bytes of input",
- args: args{bytes: []byte{0, 1, 0, 0}},
- want: 65536,
- wantErr: assert.NoError,
- },
- {
- name: "with invalid number of bytes of input",
- args: args{bytes: []byte{1, 0, 0, 0, 0, 0, 0, 0}},
- want: 0,
- wantErr: assert.Error,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := byteToInt(tt.args.bytes)
- if !tt.wantErr(t, err, fmt.Sprintf("byteToInt(%v)", tt.args.bytes)) {
- return
- }
- assert.Equalf(t, tt.want, got, "byteToInt(%v)", tt.args.bytes)
- })
- }
-}