Skip to content

Commit

Permalink
✅ add prettier file test
Browse files Browse the repository at this point in the history
  • Loading branch information
khalil committed Mar 28, 2024
1 parent 14b1667 commit d4f78db
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions prettier_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"reflect"
"testing"
)

type MockData struct {
Name string
Age int
}

func TestMakeTable(t *testing.T) {
data := []interface{}{
MockData{Name: "John", Age: 30},
MockData{Name: "Doe", Age: 40},
}

makeTable(data)
}

func TestToSlice(t *testing.T) {
a := []MockData{
{Name: "John", Age: 30},
{Name: "Doe", Age: 40},
}

result := toSlice(a)
if reflect.TypeOf(result).Kind() != reflect.Slice {
t.Errorf("Expected Slice got %v", reflect.TypeOf(result).Kind())
}
}

0 comments on commit d4f78db

Please sign in to comment.