Skip to content

Commit

Permalink
added scripting language version test
Browse files Browse the repository at this point in the history
  • Loading branch information
filipw committed Nov 4, 2020
1 parent fdb5c28 commit 14825ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/OmniSharp.Script.Tests/ScriptProjectProviderTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Scripting.Hosting;
using Microsoft.Extensions.Logging;
using OmniSharp.Services;
using Xunit;

namespace OmniSharp.Script.Tests
{
public class ScriptProjectProviderTests
{
[Fact]
public void DefaultLanguageVersionShouldBeLatest()
{
var scriptProjectProvider = new ScriptProjectProvider(new ScriptOptions(), new OmniSharpEnvironment(), new LoggerFactory(), true, false);
var scriptProjectInfo = scriptProjectProvider.CreateProject("test.csx", Enumerable.Empty<MetadataReference>(), Path.GetTempPath(), typeof(CommandLineScriptGlobals));
Assert.Equal(LanguageVersion.Latest, ((CSharpParseOptions)scriptProjectInfo.ParseOptions).SpecifiedLanguageVersion);
Assert.Equal(LanguageVersion.CSharp9, ((CSharpParseOptions)scriptProjectInfo.ParseOptions).LanguageVersion);
}
}
}
1 change: 1 addition & 0 deletions tests/OmniSharp.Script.Tests/WorkspaceInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Scripting.Hosting;
using OmniSharp.Models.FilesChanged;
using OmniSharp.Models.WorkspaceInformation;
Expand Down

0 comments on commit 14825ba

Please sign in to comment.