FAQ
Hello,

I have had the following patch knocking about in my tree for a few
months now. In the current stdlib there are 97 occurrences of the
`skip` pattern, ie, if x { t.Logf("skippng because x"} ; return }

% find pkg -name '*_test.go' | xargs egrep 't.Log.*kip' | wc -l
97

Would something like the following be an acceptable addition to the
testing package ?

https://codereview.appspot.com/6501094

In terms of LoC savings this isn't a lot, although you do get a record
of which tests were skipped rather than pass without testing anything.
You can also skip a test anywhere that has access to a *testing.T,
which is something I have found lacking currently with tests that have
a setup phase.

Cheers

Dave

--

Search Discussions

  • Minux at Jan 21, 2013 at 1:36 am

    On Mon, Jan 21, 2013 at 9:26 AM, Dave Cheney wrote:

    I have had the following patch knocking about in my tree for a few
    months now. In the current stdlib there are 97 occurrences of the
    `skip` pattern, ie, if x { t.Logf("skippng because x"} ; return }

    % find pkg -name '*_test.go' | xargs egrep 't.Log.*kip' | wc -l
    97

    Would something like the following be an acceptable addition to the
    testing package ?

    https://codereview.appspot.com/6501094

    In terms of LoC savings this isn't a lot, although you do get a record
    of which tests were skipped rather than pass without testing anything.
    You can also skip a test anywhere that has access to a *testing.T,
    which is something I have found lacking currently with tests that have
    a setup phase.
    I like this proposal.

    --
  • Andrew Gerrand at Jan 21, 2013 at 1:44 am
    I agree.

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 21, '13 at 1:26a
activeJan 21, '13 at 1:44a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase