mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2026-11-13 09:31:46 +01:00
Corrections after first run
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestDefaultConfigExpressionHelpers(t *testing.T) {
|
||||
cfg, err := Load("../../config.jsonc")
|
||||
if err != nil {
|
||||
t.Fatalf("load default config: %v", err)
|
||||
}
|
||||
|
||||
fields, rendered, errs := cfg.Evaluate([]string{
|
||||
"Relevé de compte\nBRED\n12345678901\nDate : 15/01/2026",
|
||||
})
|
||||
if len(errs) != 0 {
|
||||
t.Fatalf("evaluate default config: %v", errs)
|
||||
}
|
||||
if got, ok := fields["emissionDate"].(time.Time); !ok || got.Format("02/01/2006") != "15/01/2026" {
|
||||
t.Fatalf("emissionDate = %v, want 15/01/2026", fields["emissionDate"])
|
||||
}
|
||||
if rendered == "" {
|
||||
t.Fatal("default config rendered an empty file name")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user