Skip to content

Commit e17721f

Browse files
author
Beernaert Robbe
committed
implemented feedback from jarod
1 parent 1338f3a commit e17721f

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

modules/vstudio/tests/cs2005/test_dotnetsdk.lua

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,3 @@
141141
}
142142
]]
143143
end
144-
145-
function suite.testMSTestGlobalJSONExists()
146-
prepare()
147-
local cfg = test.getconfig(prj, "Debug")
148-
prj.dotnetsdk = "MSTest"
149-
p.generate(prj,path.join(prj.workspace.location, "global.json"), function() p.outln([[
150-
{
151-
"test:"testing"
152-
}
153-
]]) end)
154-
dn2005.output_global_json(prj)
155-
test.capture[[
156-
{
157-
"test:"testing",
158-
"msbuild-sdks":
159-
{
160-
"MSTest.Sdk": "3.6.1"
161-
}
162-
}
163-
]]
164-
end

modules/vstudio/vs2005_dotnetbase.lua

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -844,19 +844,12 @@
844844
end
845845
end
846846

847-
function dotnetbase.output_global_json(prj) -- unsure how you handle project with different config
847+
function dotnetbase.output_global_json(prj)
848848
if prj.dotnetsdk == "MSTest" then
849849
globaljson = json.decode(io.readfile(path.join(prj.workspace.location, "global.json")))
850-
if globaljson == nil then
851-
globaljson = {}
852-
globaljson["msbuild-sdks"] = {}
853-
globaljson["msbuild-sdks"]["MSTest.Sdk"] = "3.6.1"
854-
elseif globaljson["msbuild-sdks"] ~= nil then
855-
globaljson["msbuild-sdks"]["MSTest.Sdk"] = "3.6.1"
856-
else
857-
globaljson["msbuild-sdks"] = {}
858-
globaljson["msbuild-sdks"]["MSTest.Sdk"] = "3.6.1"
859-
end
850+
globaljson = globaljson or {}
851+
globaljson["msbuild-sdks"] = globaljson["msbuild-sdks"] or {}
852+
globaljson["msbuild-sdks"]["MSTest.Sdk"] = "3.6.1"
860853
_p(json.encode(globaljson))
861854
end
862855
end

0 commit comments

Comments
 (0)