mirror of
https://github.com/asticode/go-astiav.git
synced 2026-04-23 00:07:04 +08:00
Added Classer + now logs returns a Classer + tests are now done in astiav package
This commit is contained in:
@@ -61,21 +61,20 @@ func (fs {{ $val.Name }}Flags{{ $val.Suffix }}) Has(f {{ $val.Name }}Flag{{ $val
|
||||
{{ end }}`
|
||||
|
||||
var tmplTest = `// Code generated by astiav. DO NOT EDIT.
|
||||
package astiav_test
|
||||
package astiav
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/asticode/go-astiav"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
{{ range $val := . }}
|
||||
func Test{{ $val.Name }}Flags{{ $val.Suffix }}(t *testing.T) {
|
||||
fs := astiav.New{{ $val.Name }}Flags{{ $val.Suffix }}(astiav.{{ $val.Name }}Flag{{ $val.Suffix }}(1))
|
||||
require.True(t, fs.Has(astiav.{{ $val.Name }}Flag{{ $val.Suffix }}(1)))
|
||||
fs = fs.Add(astiav.{{ $val.Name }}Flag{{ $val.Suffix }}(2))
|
||||
require.True(t, fs.Has(astiav.{{ $val.Name }}Flag{{ $val.Suffix }}(2)))
|
||||
fs = fs.Del(astiav.{{ $val.Name }}Flag{{ $val.Suffix }}(2))
|
||||
require.False(t, fs.Has(astiav.{{ $val.Name }}Flag{{ $val.Suffix }}(2)))
|
||||
fs := New{{ $val.Name }}Flags{{ $val.Suffix }}({{ $val.Name }}Flag{{ $val.Suffix }}(1))
|
||||
require.True(t, fs.Has({{ $val.Name }}Flag{{ $val.Suffix }}(1)))
|
||||
fs = fs.Add({{ $val.Name }}Flag{{ $val.Suffix }}(2))
|
||||
require.True(t, fs.Has({{ $val.Name }}Flag{{ $val.Suffix }}(2)))
|
||||
fs = fs.Del({{ $val.Name }}Flag{{ $val.Suffix }}(2))
|
||||
require.False(t, fs.Has({{ $val.Name }}Flag{{ $val.Suffix }}(2)))
|
||||
}
|
||||
{{ end }}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user