diff options
Diffstat (limited to 'internal/configfile/config_test.go')
-rw-r--r-- | internal/configfile/config_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go index b8012d3..3407464 100644 --- a/internal/configfile/config_test.go +++ b/internal/configfile/config_test.go @@ -131,6 +131,30 @@ func TestCreateConfFileAESSIV(t *testing.T) { } } +func TestCreateConfLongNameMax(t *testing.T) { + args := &CreateArgs{ + Filename: "config_test/tmp.conf", + Password: testPw, + LogN: 10, + Creator: "test", + LongNameMax: 100, + } + err := Create(args) + if err != nil { + t.Fatal(err) + } + _, c, err := LoadAndDecrypt("config_test/tmp.conf", testPw) + if err != nil { + t.Fatal(err) + } + if !c.IsFeatureFlagSet(FlagLongNameMax) { + t.Error("FlagLongNameMax should be set but is not") + } + if c.LongNameMax != args.LongNameMax { + t.Errorf("wrong LongNameMax value: want=%d have=%d", args.LongNameMax, c.LongNameMax) + } +} + func TestIsFeatureFlagKnown(t *testing.T) { // Test a few hardcoded values testKnownFlags := []string{"DirIV", "PlaintextNames", "EMENames", "GCMIV128", "LongNames", "AESSIV"} |