Re: [go-nuts] assert library with generics?

2024-02-28 Thread Harri L


I’m biased as well. FWIW, this is a subpackage of the error handling 
solution, err2 .

The assertion pkg  
is proven to be a precious tool for many projects. It is unique because it 
can be used both for the test and production code runs. You’ll set, e.g., 
assert.NotEmpty(s) in whatever function you need. It’ll be checked in test 
runs *and* regular main() started runs. And all of this is done 
automatically.

For instance, if a currently tested function A calls a function B that uses 
this assertion package and violates assertion, the test fails in function 
A’s caller. Still, you get the whole location list to the call stack no 
matter how deep the call stack is to the function B. This works even over 
Go module boundaries, but you need help with the error result listing, 
e.g., the Vim plugin.

Naturally, the happy path performance has been necessary, and, e.g., 
assert.That is the same as if condition.
​
Br,
-Harri

On Monday, February 26, 2024 at 12:53:10 PM UTC+2 roger peppe wrote:

> I'm biased because I had a big hand in designing the API, but I get a lot 
> of pleasure from using this package:
>
> https://pkg.go.dev/github.com/go-quicktest/qt
>
> It does a lot more than just "equals" and "not equals" but it's still 
> relatively small and low-dependency.
> And the error messages when it fails are decent too.
>
>   cheers,
> rog.
>
> On Thu, 22 Feb 2024 at 08:20, Harmen  wrote:
>
>> Hi,
>>
>> anyone has a tip for a nice (small) "assert" test help library which uses 
>> generics for the "equals" and "not equals" functions?
>>
>> testify is the obvious library to use for tests, which works fine, but it 
>> would
>> be nice to have something which uses generics here.
>>
>> Thanks!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/ZdcDz2ULDQl02Z3R%40arp.lijzij.de
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/15daa57e-9f5e-4594-a4a9-5b4a96b7838cn%40googlegroups.com.


Re: [go-nuts] assert library with generics?

2024-02-26 Thread roger peppe
I'm biased because I had a big hand in designing the API, but I get a lot
of pleasure from using this package:

https://pkg.go.dev/github.com/go-quicktest/qt

It does a lot more than just "equals" and "not equals" but it's still
relatively small and low-dependency.
And the error messages when it fails are decent too.

  cheers,
rog.

On Thu, 22 Feb 2024 at 08:20, Harmen  wrote:

> Hi,
>
> anyone has a tip for a nice (small) "assert" test help library which uses
> generics for the "equals" and "not equals" functions?
>
> testify is the obvious library to use for tests, which works fine, but it
> would
> be nice to have something which uses generics here.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/ZdcDz2ULDQl02Z3R%40arp.lijzij.de
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAJhgacj5vM-RUOX-g0ibNXkBuFP%3D_5fucu%3D3ofh2yoN3G6YX%2BA%40mail.gmail.com.


[go-nuts] assert library with generics?

2024-02-22 Thread Harmen
Hi,

anyone has a tip for a nice (small) "assert" test help library which uses 
generics for the "equals" and "not equals" functions?

testify is the obvious library to use for tests, which works fine, but it would
be nice to have something which uses generics here.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ZdcDz2ULDQl02Z3R%40arp.lijzij.de.