Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build/CommandLine.fs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ with
seq {
for c in cases do
if c.GetFields().Length = 0 then
FSharpValue.MakeUnion(c, [| |]) :?> Build
match FSharpValue.MakeUnion(c, [| |]) with
| NonNull u -> u :?> Build
| _ -> failwithf $"%s{c.Name} can not be cast to Build enum"
}

static member Ignore (_: Build) _ = ()
Expand Down
2 changes: 0 additions & 2 deletions build/build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<PackageReference Include="Proc.Fs" Version="0.9.1" />
<PackageReference Include="Fake.Tools.Git" Version="6.1.3" />
<PackageReference Include="Fake.IO.Zip" Version="6.1.3" />
<PackageReference Remove="FSharp.Core"/>
<PackageReference Include="FSharp.Core" Version="9.0.100" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public readonly record struct Diagnostic

public interface IDiagnosticsOutput
{
public void Write(Diagnostic diagnostic);
void Write(Diagnostic diagnostic);
}

public class DiagnosticsCollector(IReadOnlyCollection<IDiagnosticsOutput> outputs)
Expand Down
18 changes: 14 additions & 4 deletions tests/authoring/Framework/ErrorCollectorAssertions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ module DiagnosticsCollectorAssertions =
.Where(fun d -> d.Severity = Severity.Error)
.ToArray()
|> List.ofArray
let message = errorDiagnostics.FirstOrDefault().Message
test <@ message.Contains(expected) @>
|> List.tryHead

match errorDiagnostics with
| Some e ->
let message = e.Message
test <@ message.Contains(expected) @>
| None -> failwithf "Expected errors but no errors were logged"


let hasNoWarnings (actual: Lazy<GeneratorResults>) =
let actual = actual.Value
Expand All @@ -43,5 +49,9 @@ module DiagnosticsCollectorAssertions =
.Where(fun d -> d.Severity = Severity.Warning)
.ToArray()
|> List.ofArray
let message = errorDiagnostics.FirstOrDefault().Message
test <@ message.Contains(expected) @>
|> List.tryHead
match errorDiagnostics with
| Some e ->
let message = e.Message
test <@ message.Contains(expected) @>
| None -> failwithf "Expected errors but no errors were logged"