From 6279068cca1a531ab8501aff587b66b4beebea20 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Nikolov Date: Sun, 21 Apr 2024 14:18:39 +0300 Subject: [PATCH] Move `fixtures` package to `pkg/fixtures` --- fixtures/fixtures.go | 9 ----- pkg/fixtures/fixtures.go | 34 +++++++++++++++++++ .../fixtures}/sample_gnu_make_db_3.81.txt | 0 .../fixtures}/sample_gnu_make_db_4.4.1.txt | 0 pkg/parser/parser_test.go | 2 +- 5 files changed, 35 insertions(+), 10 deletions(-) delete mode 100644 fixtures/fixtures.go create mode 100644 pkg/fixtures/fixtures.go rename {fixtures => pkg/fixtures}/sample_gnu_make_db_3.81.txt (100%) rename {fixtures => pkg/fixtures}/sample_gnu_make_db_4.4.1.txt (100%) diff --git a/fixtures/fixtures.go b/fixtures/fixtures.go deleted file mode 100644 index 5291ddc..0000000 --- a/fixtures/fixtures.go +++ /dev/null @@ -1,9 +0,0 @@ -package fixtures - -import _ "embed" - -//go:embed sample_gnu_make_db_3.81.txt -var SampleDb_v3_81 string - -//go:embed sample_gnu_make_db_4.4.1.txt -var SampleDb_v4_4_1 string diff --git a/pkg/fixtures/fixtures.go b/pkg/fixtures/fixtures.go new file mode 100644 index 0000000..067717d --- /dev/null +++ b/pkg/fixtures/fixtures.go @@ -0,0 +1,34 @@ +// Copyright (c) 2024 Marin Atanasov Nikolov +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +package fixtures + +import _ "embed" + +//go:embed sample_gnu_make_db_3.81.txt +var SampleDb_v3_81 string + +//go:embed sample_gnu_make_db_4.4.1.txt +var SampleDb_v4_4_1 string diff --git a/fixtures/sample_gnu_make_db_3.81.txt b/pkg/fixtures/sample_gnu_make_db_3.81.txt similarity index 100% rename from fixtures/sample_gnu_make_db_3.81.txt rename to pkg/fixtures/sample_gnu_make_db_3.81.txt diff --git a/fixtures/sample_gnu_make_db_4.4.1.txt b/pkg/fixtures/sample_gnu_make_db_4.4.1.txt similarity index 100% rename from fixtures/sample_gnu_make_db_4.4.1.txt rename to pkg/fixtures/sample_gnu_make_db_4.4.1.txt diff --git a/pkg/parser/parser_test.go b/pkg/parser/parser_test.go index 3ca9f65..8d73a74 100644 --- a/pkg/parser/parser_test.go +++ b/pkg/parser/parser_test.go @@ -31,7 +31,7 @@ import ( "strings" "testing" - "github.com/dnaeon/makefile-graph/fixtures" + "github.com/dnaeon/makefile-graph/pkg/fixtures" "gopkg.in/dnaeon/go-graph.v1" )