From c3a565adf54b8d01e0af5a0af1cfcb3e1a0661cd Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 7 Aug 2023 22:10:48 +0200 Subject: [PATCH] go(localbreach): add test+testdata --- modules/localbreach/breach_test.go | 21 +++++++++++++++++++++ modules/localbreach/testdata/test1.yaml | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 modules/localbreach/breach_test.go create mode 100644 modules/localbreach/testdata/test1.yaml diff --git a/modules/localbreach/breach_test.go b/modules/localbreach/breach_test.go new file mode 100644 index 0000000..8833ca7 --- /dev/null +++ b/modules/localbreach/breach_test.go @@ -0,0 +1,21 @@ +// Copyright 2023 wanderer +// SPDX-License-Identifier: AGPL-3.0-only + +package localbreach + +import ( + "path" + "testing" +) + +func TestLocalbreach(t *testing.T) { + testDir := "./testdata" + t1 := "test1.yaml" + + schema, err := Load(path.Join(testDir, t1)) + if err != nil { + t.Fatal(err) + } + + t.Logf("schema: %+v", schema) +} diff --git a/modules/localbreach/testdata/test1.yaml b/modules/localbreach/testdata/test1.yaml new file mode 100644 index 0000000..2b871cd --- /dev/null +++ b/modules/localbreach/testdata/test1.yaml @@ -0,0 +1,21 @@ +# Copyright 2023 wanderer +# SPDX-License-Identifier: AGPL-3.0-only + +--- +name: test breach 1 +time: 2022-11-11 +isVerified: false +containsPasswds: true +containsHashes: false +containsUsernames: false +containsEmails: true +data: + emails: + - aa@bb.cc + - jdsalk@jfhdkls.com + - dfjsnlads@gmail.com + passwds: + - password1 + - qwertyasdf + - 0987654321 +...