Skip to content
Draft
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
2 changes: 2 additions & 0 deletions WoofWare.Expect/SnapshotUpdate.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace WoofWare.Expect

open System
open System.Text.RegularExpressions
open Fantomas.FCS.Text

type private StringLiteralInfo =
{
Expand Down Expand Up @@ -207,6 +208,7 @@ module internal SnapshotUpdate =
/// instead returns the new contents.
/// We always write single-quoted @-strings for simplicity.
let private updateSnapshot (lines : string[]) (info : StringLiteralInfo) (newContent : string) : string[] =
let f, _ = Fantomas.FCS.Parse.parseFile false (SourceText.ofString (String.concat "\n" lines)) []
let newString = "@\"" + newContent.Replace ("\"", "\"\"") + "\""

if info.StartLine = info.EndLine then
Expand Down
5 changes: 3 additions & 2 deletions WoofWare.Expect/WoofWare.Expect.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
</ItemGroup>

<ItemGroup>
<!-- FSharp.SystemTextJson requires at least this version -->
<PackageReference Update="FSharp.Core" Version="4.7.0" />
<!-- Fantomas.FCS requires at least this version -->
<PackageReference Update="FSharp.Core" Version="8.0.100" />
<PackageReference Include="Fantomas.FCS" Version="7.0.3" />
<PackageReference Include="FSharp.SystemTextJson" Version="1.4.36" />
<!-- Needed for DeepEquals -->
<PackageReference Include="System.Text.Json" Version="9.0.0" />
Expand Down
Loading