1// Copyright 2023 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package main
6
7import (
8	"internal/platform"
9	"testing"
10)
11
12// TestMustLinkExternal verifies that the mustLinkExternal helper
13// function matches internal/platform.MustLinkExternal.
14func TestMustLinkExternal(t *testing.T) {
15	for _, goos := range okgoos {
16		for _, goarch := range okgoarch {
17			for _, cgoEnabled := range []bool{true, false} {
18				got := mustLinkExternal(goos, goarch, cgoEnabled)
19				want := platform.MustLinkExternal(goos, goarch, cgoEnabled)
20				if got != want {
21					t.Errorf("mustLinkExternal(%q, %q, %v) = %v; want %v", goos, goarch, cgoEnabled, got, want)
22				}
23			}
24		}
25	}
26}
27