Coder Social home page Coder Social logo

tideland / go-audit Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 106 KB

Powerful testers, test data generators, capturing of stdout/stderr and test-wide manipulation of the environment help with powerful unit tests

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.60% Go 99.40%
golang testing testing-tools test-driven-development go assertions capturing environment-variables test-data-generator

go-audit's Issues

Make asserts testing use the testing.T Logf()

Current used StandardPrinter uses stdout and stderr which leads to troubles in CI systems. So it's better to create a TestingPrinter using the T.Logf(). So it better uses its flags and behavior.

Add Assert.Zero()

Add the test Assert.Zero(), which tests one argument. It is successful, when

  • numbers are 0 or 0.0,
  • booleans are false,
  • strings are "",
  • arrays, slices and maps are empty and
  • slices, maps, channels, functions and references are nil.

asserts: Fix ifaceToError()

  • May today return nil errors in case of illegal data
  • Should return an additional bool indicating if the error is valid or not

Migrate to Go 1.18

  • Change go.mod to 1.18
  • Change asserts to use generics (and any where needed)
  • Use fuzzy testing

Add Assert.OneOf()

The method

OneOf(obtained interface{}, valids []interface{}, msgs ...string)

checks if the obtained value is one of the valid ones.

Add Asserts.NotPanics()

Assert method NotPanics() is the opposite to Panics() an checks if a test function with the risk for panicking in a given test case does not panic.

Fix found minor bugs

  • Found typos in intro comments
  • assert.ErrorMatch() reacts intolerant on pointers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.