Skip to content

Commit c2461da

Browse files
committed
Merge branch 'main' into version-docs
2 parents 7f68ab4 + 7d28b29 commit c2461da

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

build/CommandLine.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ with
7474
seq {
7575
for c in cases do
7676
if c.GetFields().Length = 0 then
77-
FSharpValue.MakeUnion(c, [| |]) :?> Build
77+
match FSharpValue.MakeUnion(c, [| |]) with
78+
| NonNull u -> u :?> Build
79+
| _ -> failwithf $"%s{c.Name} can not be cast to Build enum"
7880
}
7981

8082
static member Ignore (_: Build) _ = ()

build/build.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
<PackageReference Include="Proc.Fs" Version="0.9.1" />
1313
<PackageReference Include="Fake.Tools.Git" Version="6.1.3" />
1414
<PackageReference Include="Fake.IO.Zip" Version="6.1.3" />
15-
<PackageReference Remove="FSharp.Core"/>
16-
<PackageReference Include="FSharp.Core" Version="9.0.100" />
1715
</ItemGroup>
1816

1917
<ItemGroup>

src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public readonly record struct Diagnostic
5656

5757
public interface IDiagnosticsOutput
5858
{
59-
public void Write(Diagnostic diagnostic);
59+
void Write(Diagnostic diagnostic);
6060
}
6161

6262
public class DiagnosticsCollector(IReadOnlyCollection<IDiagnosticsOutput> outputs)

tests/authoring/Framework/ErrorCollectorAssertions.fs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ module DiagnosticsCollectorAssertions =
2727
.Where(fun d -> d.Severity = Severity.Error)
2828
.ToArray()
2929
|> List.ofArray
30-
let message = errorDiagnostics.FirstOrDefault().Message
31-
test <@ message.Contains(expected) @>
30+
|> List.tryHead
31+
32+
match errorDiagnostics with
33+
| Some e ->
34+
let message = e.Message
35+
test <@ message.Contains(expected) @>
36+
| None -> failwithf "Expected errors but no errors were logged"
37+
3238

3339
let hasNoWarnings (actual: Lazy<GeneratorResults>) =
3440
let actual = actual.Value
@@ -43,5 +49,9 @@ module DiagnosticsCollectorAssertions =
4349
.Where(fun d -> d.Severity = Severity.Warning)
4450
.ToArray()
4551
|> List.ofArray
46-
let message = errorDiagnostics.FirstOrDefault().Message
47-
test <@ message.Contains(expected) @>
52+
|> List.tryHead
53+
match errorDiagnostics with
54+
| Some e ->
55+
let message = e.Message
56+
test <@ message.Contains(expected) @>
57+
| None -> failwithf "Expected errors but no errors were logged"

0 commit comments

Comments
 (0)