Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandra shekar Varkala committed Jan 27, 2023
1 parent bf09532 commit 5f18cf0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
3 changes: 3 additions & 0 deletions coverage.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mode: set
github.com/chandumlg/hello/internal/hello.go:13.27,15.2 1 1
github.com/chandumlg/hello/internal/hello.go:17.23,19.2 1 1
11 changes: 0 additions & 11 deletions hello.go

This file was deleted.

19 changes: 19 additions & 0 deletions internal/hello.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package internal

import "rsc.io/quote/v3"

type Helloer interface {
Hello() string
}

type Hi struct {
test int
}

func (*Hi) Hello() string {
return quote.HelloV3()
}

func Proverb() string {
return quote.Concurrency()
}
5 changes: 3 additions & 2 deletions hello_test.go → internal/hello_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package hello
package internal

import (
"testing"
)

func TestHello(t *testing.T) {
want := "Hello, world."
if got := Hello(); got != want {
testHi := &Hi{}
if got := testHi.Hello(); got != want {
t.Errorf("Hello() = %q, want %q", got, want)
}
}
Expand Down
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"fmt"

. "github.com/chandumlg/hello/internal"
)

func main() {
testHi := &Hi{}
fmt.Println(testHi.Hello())
}

0 comments on commit 5f18cf0

Please sign in to comment.