Added Classer + now logs returns a Classer + tests are now done in astiav package

This commit is contained in:
Quentin Renard
2024-02-28 18:05:36 +01:00
parent 7fe358fbfa
commit b5db8fb22f
51 changed files with 1177 additions and 808 deletions
+7 -8
View File
@@ -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 }}`