Skip to content

Commit

Permalink
Merge pull request #13278 from chrisroberts/windows-arch-map
Browse files Browse the repository at this point in the history
Update CPU mapping values
  • Loading branch information
chrisroberts authored Oct 19, 2023
2 parents 728f7af + 3367154 commit 2750997
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/vagrant/util/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def architecture
end

@_host_architecture = case RbConfig::CONFIG["target_cpu"]
when "x86_64"
when "amd64", "x86_64", "x64"
"amd64"
when "i386"
"386"
when "386", "i386", "x86"
"i386"
when "arm64", "aarch64"
"arm64"
else
Expand Down
18 changes: 17 additions & 1 deletion test/unit/vagrant/util/platform_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,27 @@
end
end

context "when cpu is x64" do
let(:cpu_string) { "x64" }

it "should be mapped to amd64" do
expect(described_class.architecture).to eq("amd64")
end
end

context "when cpu is i386" do
let(:cpu_string) { "i386" }

it "should be mapped to i386" do
expect(described_class.architecture).to eq("i386")
end
end

context "when cpu is 386" do
let(:cpu_string) { "386" }

it "should be mapped to 386" do
expect(described_class.architecture).to eq("386")
expect(described_class.architecture).to eq("i386")
end
end

Expand Down

0 comments on commit 2750997

Please sign in to comment.