3 Commits

Author SHA1 Message Date
Patrick Stevens
fbce97878f Switch to trusted publishing (#31) 2025-10-03 09:54:37 +00:00
Patrick Stevens
6f613587b5 Bump ApiSurface (#30) 2025-09-08 20:39:47 +00:00
Patrick Stevens
6d9dbc59db Better error message on failure to find keyword (#29) 2025-09-02 07:56:58 +01:00
6 changed files with 62 additions and 57 deletions

View File

@@ -249,12 +249,17 @@ jobs:
- name: Identify `dotnet` - name: Identify `dotnet`
id: dotnet-identify id: dotnet-identify
run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT' run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT'
- name: Obtain NuGet key
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish to NuGet - name: Publish to NuGet
id: publish-success id: publish-success
uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059 uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059
with: with:
package-name: WoofWare.Expect package-name: WoofWare.Expect
nuget-key: ${{ secrets.NUGET_API_KEY }} nuget-key: ${{ steps.login.outputs.NUGET_API_KEY }}
nupkg-dir: packed/ nupkg-dir: packed/
dotnet: ${{ steps.dotnet-identify.outputs.dotnet }} dotnet: ${{ steps.dotnet-identify.outputs.dotnet }}

View File

@@ -211,4 +211,4 @@ Observe the `OneTimeSetUp` which sets global state to enter "bulk update" mode,
# Licence # Licence
MIT. WoofWare.Expect is licensed to you under the MIT licence, a copy of which can be found at [LICENSE](./LICENSE).

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
@@ -37,14 +37,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ApiSurface" Version="4.1.20" /> <PackageReference Include="ApiSurface" Version="5.0.1" />
<PackageReference Include="FsUnit" Version="7.0.1" /> <PackageReference Include="FsUnit" Version="7.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1"/> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1"/>
<PackageReference Include="NUnit" Version="4.3.2"/> <PackageReference Include="NUnit" Version="4.3.2"/>
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0"/> <PackageReference Include="NUnit3TestAdapter" Version="5.0.0"/>
<!-- TODO: when ApiSurface accepts https://github.com/G-Research/ApiSurface/pull/116, upgrade these --> <PackageReference Include="System.IO.Abstractions" Version="22.0.15" />
<PackageReference Include="System.IO.Abstractions" Version="4.2.13" /> <PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.0.15" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="4.2.13" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -205,9 +205,15 @@ module internal AstWalker =
| ParsedInput.SigFile _ -> failwith "unexpected: signature files can't contain expressions" | ParsedInput.SigFile _ -> failwith "unexpected: signature files can't contain expressions"
// Find the closest match // Find the closest match
results let matches =
|> Seq.filter (fun loc -> results
loc.KeywordRange.StartLine <= lineNumber |> List.filter (fun loc ->
&& lineNumber <= loc.KeywordRange.EndLine loc.KeywordRange.StartLine <= lineNumber
) && lineNumber <= loc.KeywordRange.EndLine
|> Seq.exactlyOne )
match matches with
| [] ->
failwith
$"Unexpectedly failed to locate snapshot keyword %s{methodName} at line %i{lineNumber} of file %s{infoFilePath}. Please report this along with the contents of the file."
| m :: _ -> m

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<Authors>Patrick Stevens</Authors> <Authors>PatrickStevens</Authors>
<Copyright>Copyright (c) Patrick Stevens 2025</Copyright> <Copyright>Copyright (c) Patrick Stevens 2025</Copyright>
<Description>Snapshot/expect testing framework for F#</Description> <Description>Snapshot/expect testing framework for F#</Description>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>

View File

@@ -1,8 +1,8 @@
[ [
{ {
"pname": "ApiSurface", "pname": "ApiSurface",
"version": "4.1.20", "version": "5.0.1",
"hash": "sha256-koWgO9FC9ax+Ij56ug8kxeyknl0yhLqnNLOUdxtqqo4=" "hash": "sha256-0GMXEMFgWbbE2OGxW+6h4zGgQHg+IZy1aI13Dn97xSU="
}, },
{ {
"pname": "fantomas", "pname": "fantomas",
@@ -69,11 +69,6 @@
"version": "1.1.1", "version": "1.1.1",
"hash": "sha256-8hLiUKvy/YirCWlFwzdejD2Db3DaXhHxT7GSZx/znJg=" "hash": "sha256-8hLiUKvy/YirCWlFwzdejD2Db3DaXhHxT7GSZx/znJg="
}, },
{
"pname": "Microsoft.NETCore.Platforms",
"version": "2.0.0",
"hash": "sha256-IEvBk6wUXSdyCnkj6tHahOJv290tVVT8tyemYcR0Yro="
},
{ {
"pname": "Microsoft.NETCore.Targets", "pname": "Microsoft.NETCore.Targets",
"version": "1.1.0", "version": "1.1.0",
@@ -141,33 +136,33 @@
}, },
{ {
"pname": "NuGet.Common", "pname": "NuGet.Common",
"version": "6.13.2", "version": "6.14.0",
"hash": "sha256-ASLa/Jigg5Eop0ZrXPl98RW2rxnJRC7pbbxhuV74hFw=" "hash": "sha256-jDOwt3veI1GSG8CfBnf2+dJxD3E/Nmlc+vHtD4J76Ms="
}, },
{ {
"pname": "NuGet.Configuration", "pname": "NuGet.Configuration",
"version": "6.13.2", "version": "6.14.0",
"hash": "sha256-z8VW1YdRDanyyRTDYRvRkSv/XPR3c/hMM1y8cNNjx0Y=" "hash": "sha256-1PN9s6fhCw3wd2260U6hQ4vG3jIvcG8GIn1oQgxMXA0="
}, },
{ {
"pname": "NuGet.Frameworks", "pname": "NuGet.Frameworks",
"version": "6.13.2", "version": "6.14.0",
"hash": "sha256-caDyc+WgYOo43AUTjtbP0MyvYDb6JweEKDdIul61Cac=" "hash": "sha256-3ViM3R1ucQMEL2hQYsivT86kI6veMQK2xDsiAcFcVQk="
}, },
{ {
"pname": "NuGet.Packaging", "pname": "NuGet.Packaging",
"version": "6.13.2", "version": "6.14.0",
"hash": "sha256-lhO+SFwIYZ4aPHxIGm5ubkkE2a5Ve2xgtroRbNh7hpw=" "hash": "sha256-Yafbnxs3maj55bJ1oKQiZ0QkntFUzXdhorL94YEUOhY="
}, },
{ {
"pname": "NuGet.Protocol", "pname": "NuGet.Protocol",
"version": "6.13.2", "version": "6.14.0",
"hash": "sha256-5lnAHHZjy7A4vgv65AeBAs64mSNpuoUjxW3HnrMpuzY=" "hash": "sha256-uLDKfs+QN1MdnuQtTES8qfNzzsmYKM6XB9pwJc4G+eo="
}, },
{ {
"pname": "NuGet.Versioning", "pname": "NuGet.Versioning",
"version": "6.13.2", "version": "6.14.0",
"hash": "sha256-gmpyBpKnt+GHqgx/2uFKp+J2csbxEAy1E7WdVT117sw=" "hash": "sha256-DqdOJgsphKxSvqB8b60zNPCaiLfbiu3WnUJ/90feLrY="
}, },
{ {
"pname": "NUnit", "pname": "NUnit",
@@ -224,25 +219,15 @@
"version": "6.0.0", "version": "6.0.0",
"hash": "sha256-KaMHgIRBF7Nf3VwOo+gJS1DcD+41cJDPWFh+TDQ8ee8=" "hash": "sha256-KaMHgIRBF7Nf3VwOo+gJS1DcD+41cJDPWFh+TDQ8ee8="
}, },
{
"pname": "System.Formats.Asn1",
"version": "8.0.1",
"hash": "sha256-may/Wg+esmm1N14kQTG4ESMBi+GQKPp0ZrrBo/o6OXM="
},
{ {
"pname": "System.IO.Abstractions", "pname": "System.IO.Abstractions",
"version": "4.2.13", "version": "22.0.15",
"hash": "sha256-nkC/PiqE6+c1HJ2yTwg3x+qdBh844Z8n3ERWDW8k6Gg=" "hash": "sha256-2deBvDALOzd+BAnhdbnR7ZPjChE71HPv7w61/2tfYOg="
}, },
{ {
"pname": "System.IO.Abstractions.TestingHelpers", "pname": "System.IO.Abstractions.TestingHelpers",
"version": "4.2.13", "version": "22.0.15",
"hash": "sha256-WGGatXlgyROnptdw0zU3ggf54eD/zusO/fvtf+5wuPU=" "hash": "sha256-JRm8yApCvhB/cvkPcm3+SKURhVB+ykF1u3IrxSJ7CLQ="
},
{
"pname": "System.IO.FileSystem.AccessControl",
"version": "4.5.0",
"hash": "sha256-ck44YBQ0M+2Im5dw0VjBgFD1s0XuY54cujrodjjSBL8="
}, },
{ {
"pname": "System.IO.Pipelines", "pname": "System.IO.Pipelines",
@@ -294,11 +279,6 @@
"version": "6.1.0", "version": "6.1.0",
"hash": "sha256-NyqqpRcHumzSxpsgRDguD5SGwdUNHBbo0OOdzLTIzCU=" "hash": "sha256-NyqqpRcHumzSxpsgRDguD5SGwdUNHBbo0OOdzLTIzCU="
}, },
{
"pname": "System.Security.AccessControl",
"version": "4.5.0",
"hash": "sha256-AFsKPb/nTk2/mqH/PYpaoI8PLsiKKimaXf+7Mb5VfPM="
},
{ {
"pname": "System.Security.Cryptography.Pkcs", "pname": "System.Security.Cryptography.Pkcs",
"version": "6.0.4", "version": "6.0.4",
@@ -309,11 +289,6 @@
"version": "4.4.0", "version": "4.4.0",
"hash": "sha256-Ri53QmFX8I8UH0x4PikQ1ZA07ZSnBUXStd5rBfGWFOE=" "hash": "sha256-Ri53QmFX8I8UH0x4PikQ1ZA07ZSnBUXStd5rBfGWFOE="
}, },
{
"pname": "System.Security.Principal.Windows",
"version": "4.5.0",
"hash": "sha256-BkUYNguz0e4NJp1kkW7aJBn3dyH9STwB5N8XqnlCsmY="
},
{ {
"pname": "System.Text.Encodings.Web", "pname": "System.Text.Encodings.Web",
"version": "9.0.0", "version": "9.0.0",
@@ -338,5 +313,25 @@
"pname": "System.Threading.Tasks.Extensions", "pname": "System.Threading.Tasks.Extensions",
"version": "4.5.4", "version": "4.5.4",
"hash": "sha256-owSpY8wHlsUXn5xrfYAiu847L6fAKethlvYx97Ri1ng=" "hash": "sha256-owSpY8wHlsUXn5xrfYAiu847L6fAKethlvYx97Ri1ng="
},
{
"pname": "TestableIO.System.IO.Abstractions",
"version": "22.0.15",
"hash": "sha256-6YwnBfAnsxM0lEPB2LOFQcs7d1r7CyqjDEmvUBTz+X0="
},
{
"pname": "TestableIO.System.IO.Abstractions.TestingHelpers",
"version": "22.0.15",
"hash": "sha256-xEmfPBCtVVLc7K494cUuPXIYbUc/GPQlFC7UkDXP2jM="
},
{
"pname": "TestableIO.System.IO.Abstractions.Wrappers",
"version": "22.0.15",
"hash": "sha256-KoGuXGzecpf4rTmEth4/2goVFFR9V2aj+iibfZxpR7U="
},
{
"pname": "Testably.Abstractions.FileSystem.Interface",
"version": "9.0.0",
"hash": "sha256-6JW+qDtqQT9StP4oTR7uO0NnmVc2xcjSZ6ds2H71wtg="
} }
] ]