Skip to content

Commit

Permalink
create basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishi Davidson authored and Nishi Davidson committed Mar 30, 2020
1 parent a9a91cc commit 3751154
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions static-array/static-array.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main


func CreateArr() []int {
a := []int{1,2,5,7,9}
return a
}
16 changes: 16 additions & 0 deletions static-array/static-array_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"testing"
"reflect"
)

func TestCreateArr(t *testing.T) {
got := CreateArr()
want:= []int{1,2,5,7,9}

if !reflect.DeepEqual(got, want) {
t.Errorf("got %q want %q", got,want)
}
}

0 comments on commit 3751154

Please sign in to comment.