From 8144982a26c6b8e5f0f5401c2a2de99e4ced04cd Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 19 Sep 2023 16:46:40 +0200 Subject: sys: refactor const extraction 1) Make FabricateSyscallConsts() operate on ConstFile. 2) Expose Pos inside ConstInfo. --- pkg/compiler/consts_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pkg/compiler/consts_test.go') diff --git a/pkg/compiler/consts_test.go b/pkg/compiler/consts_test.go index a0e4c1c8d..ab8bc48f7 100644 --- a/pkg/compiler/consts_test.go +++ b/pkg/compiler/consts_test.go @@ -41,8 +41,12 @@ func TestExtractConsts(t *testing.T) { "CONST26", } sort.Strings(wantConsts) - if !reflect.DeepEqual(info.Consts, wantConsts) { - t.Fatalf("got consts:\n%q\nwant:\n%q", info.Consts, wantConsts) + var constNames []string + for _, def := range info.Consts { + constNames = append(constNames, def.Name) + } + if !reflect.DeepEqual(constNames, wantConsts) { + t.Fatalf("got consts:\n%q\nwant:\n%q", constNames, wantConsts) } wantIncludes := []string{"foo/bar.h", "bar/foo.h"} if !reflect.DeepEqual(info.Includes, wantIncludes) { -- cgit mrf-deployment