Skip to content

GoCelesteAI/go_testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Tutorial - Lesson 29: Unit Testing

This repository contains the source code for Go Tutorial for Beginners #29 - Unit Testing.

Examples

  • test_basics/ - Writing test functions with func TestX(t *testing.T), running tests with go test -v
  • test_table/ - Table-driven tests using struct slices for data-driven testing
  • test_subtests/ - Subtests with t.Run() for organized, named test cases
  • test_helpers/ - Test helpers with t.Helper(), TestMain for setup/teardown, t.Skip()

Running the Examples

cd test_basics && go test -v
cd test_table && go test -v
cd test_subtests && go test -v
cd test_helpers && go test -v

Watch the Tutorial

Go Tutorial for Beginners #29 - Unit Testing

License

MIT License - Feel free to use this code for learning!

About

Go Tutorial #29 - Unit Testing: Table Tests, Subtests & Helpers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages