From 05e665bec705f4ee3e12238d17e1b04fb000b2fc Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Fri, 18 Dec 2009 22:40:40 +0000 Subject: [PATCH] add irc_test.go, update Makefile and .gitignore add simple test code to make building this package within src/pkg happy; update irc/Makefile whitespace -- s/ /\t/; update .gitignore to ignore _test directory created in test build; --- .gitignore | 1 + irc/Makefile | 6 +++--- irc/irc_test.go | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 irc/irc_test.go diff --git a/.gitignore b/.gitignore index 625c3f0..93233d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /gobot *.[568] _obj/ +_test/ *.swp *~ *.out diff --git a/irc/Makefile b/irc/Makefile index 08e7382..813442c 100644 --- a/irc/Makefile +++ b/irc/Makefile @@ -7,8 +7,8 @@ include $(GOROOT)/src/Make.$(GOARCH) TARG=irc GOFILES=\ connection.go\ - commands.go\ - handlers.go\ - nickchan.go + commands.go\ + handlers.go\ + nickchan.go include $(GOROOT)/src/Make.pkg diff --git a/irc/irc_test.go b/irc/irc_test.go new file mode 100644 index 0000000..eba9ca6 --- /dev/null +++ b/irc/irc_test.go @@ -0,0 +1,15 @@ +package irc + +import ( + "testing" +) + +// Not really sure what or how to test something that basically requires a +// connection to an IRC server to function, but we need some tests or when this +// is present in the go package tree builds fail hard :-( +func TestIRC(t *testing.T) { + if c := New("test", "test", "Testing IRC"); c == nil { + t.FailNow() + } +} +