From 7d452ea5333dba35100abd7df45d7e8881481a22 Mon Sep 17 00:00:00 2001 From: Smaug123 <3138005+Smaug123@users.noreply.github.com> Date: Thu, 24 Jul 2025 08:42:00 +0100 Subject: [PATCH] WIP --- WoofWare.Expect/SnapshotUpdate.fs | 2 ++ WoofWare.Expect/WoofWare.Expect.fsproj | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/WoofWare.Expect/SnapshotUpdate.fs b/WoofWare.Expect/SnapshotUpdate.fs index acc8706..636c18e 100644 --- a/WoofWare.Expect/SnapshotUpdate.fs +++ b/WoofWare.Expect/SnapshotUpdate.fs @@ -2,6 +2,7 @@ namespace WoofWare.Expect open System open System.Text.RegularExpressions +open Fantomas.FCS.Text type private StringLiteralInfo = { @@ -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 diff --git a/WoofWare.Expect/WoofWare.Expect.fsproj b/WoofWare.Expect/WoofWare.Expect.fsproj index 102bae6..040878d 100644 --- a/WoofWare.Expect/WoofWare.Expect.fsproj +++ b/WoofWare.Expect/WoofWare.Expect.fsproj @@ -36,8 +36,9 @@ - - + + +