diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-09-19 16:46:40 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-10-04 09:27:33 +0000 |
| commit | 8144982a26c6b8e5f0f5401c2a2de99e4ced04cd (patch) | |
| tree | e17e1e9cfd27739da3f002744506d22e73ff2c0d /pkg/compiler/consts_test.go | |
| parent | c4dc646bee41c7e983a13750652f1035ae27b737 (diff) | |
sys: refactor const extraction
1) Make FabricateSyscallConsts() operate on ConstFile.
2) Expose Pos inside ConstInfo.
Diffstat (limited to 'pkg/compiler/consts_test.go')
| -rw-r--r-- | pkg/compiler/consts_test.go | 8 |
1 files changed, 6 insertions, 2 deletions
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) { |
