Fix CrossTarget.parse test on platforms where abi != gnu

Closes #4902
This commit is contained in:
Timon Kruiper 2020-04-01 22:46:02 +02:00 committed by Andrew Kelley
parent 2b6dfdd3d4
commit eefb0a36c0

View File

@ -765,7 +765,15 @@ test "CrossTarget.parse" {
const text = try cross_target.zigTriple(std.testing.allocator);
defer std.testing.allocator.free(text);
std.testing.expectEqualSlices(u8, "native-native-gnu.2.1.1", text);
var buf: [256]u8 = undefined;
const triple = std.fmt.bufPrint(
buf[0..],
"native-native-{}.2.1.1",
.{@tagName(std.Target.current.abi)},
) catch unreachable;
std.testing.expectEqualSlices(u8, triple, text);
}
{
const cross_target = try CrossTarget.parse(.{