forked from dafny-lang/dafny
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug that occurred when using resolution caching and replaceable m…
…odules (dafny-lang#5189) Fixes dafny-lang#5187 ### Description Fix bug that occurred when using resolution caching in combination with replaceable modules ### How has this been tested? Added a language server test <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
- Loading branch information
1 parent
11eb68d
commit b144df2
Showing
4 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Source/DafnyLanguageServer.Test/ProjectFiles/StandardLibrary.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Microsoft.Dafny.LanguageServer.IntegrationTest.Util; | ||
using Microsoft.Extensions.Logging; | ||
using OmniSharp.Extensions.LanguageServer.Protocol.Models; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Microsoft.Dafny.LanguageServer.IntegrationTest.ProjectFiles; | ||
|
||
public class StandardLibrary : ClientBasedLanguageServerTest { | ||
|
||
[Fact] | ||
public async Task EditWhenUsingStandardLibrary() { | ||
var projectFile = @" | ||
[options] | ||
standard-libraries=true | ||
"; | ||
var program = @" | ||
method Foo() ensures false { } | ||
".TrimStart(); | ||
var path = Path.GetRandomFileName(); | ||
var project = CreateAndOpenTestDocument(projectFile, Path.Combine(path, DafnyProject.FileName)); | ||
var document = CreateAndOpenTestDocument(program, Path.Combine(path, "EditWhenUsingStandardLibrary.dfy")); | ||
var diagnostics1 = await GetLastDiagnostics(document); | ||
Assert.Single(diagnostics1); | ||
ApplyChange(ref document, new Range(0, 0, 1, 0), "method Bar() ensures true { }"); | ||
var diagnostics2 = await GetLastDiagnostics(document); | ||
Assert.Empty(diagnostics2); | ||
} | ||
|
||
public StandardLibrary(ITestOutputHelper output, LogLevel dafnyLogLevel = LogLevel.Information) : base(output, dafnyLogLevel) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters