diff --git a/cmd/csaf_downloader/forwarder_test.go b/cmd/csaf_downloader/forwarder_test.go new file mode 100644 index 00000000..61d18f93 --- /dev/null +++ b/cmd/csaf_downloader/forwarder_test.go @@ -0,0 +1,26 @@ +// This file is Free Software under the MIT License +// without warranty, see README.md and LICENSES/MIT.txt for details. +// +// SPDX-License-Identifier: MIT +// +// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) +// Software-Engineering: 2023 Intevation GmbH + +package main + +import "testing" + +func TestValidationStatusUpdate(t *testing.T) { + sv := validValidationStatus + sv.update(invalidValidationStatus) + sv.update(validValidationStatus) + if sv != invalidValidationStatus { + t.Fatalf("got %q expected %q", sv, invalidValidationStatus) + } + sv = notValidatedValidationStatus + sv.update(validValidationStatus) + sv.update(notValidatedValidationStatus) + if sv != notValidatedValidationStatus { + t.Fatalf("got %q expected %q", sv, notValidatedValidationStatus) + } +}