Skip to content

Commit f1b4362

Browse files
committed
refactor: adapt test cases for dotnet runtime
1 parent eaf9590 commit f1b4362

File tree

4 files changed

+20
-37
lines changed

4 files changed

+20
-37
lines changed

inst/rawrrassembly/rawrr-dotnet.csproj

-17
This file was deleted.

inst/rawrrassembly/rawrr.csproj

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework> <!-- Or net7.0, depending on your setup -->
36
<AssemblyName>rawrr</AssemblyName>
4-
<OutputPath>bin\</OutputPath>
7+
<PublishSingleFile>true</PublishSingleFile>
8+
<SelfContained>true</SelfContained>
59
</PropertyGroup>
6-
<ItemGroup>
7-
<Compile Include="rawrr.cs" />
8-
</ItemGroup>
9-
10-
<Target Name="Build">
11-
<MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" />
12-
<Csc Sources="@(Compile)" OutputAssembly="$(OutputPath)$(AssemblyName).exe" References="@(Reference)" AdditionalLibPaths="$(AdditionalLibPaths)" Optimize="true" Platform="anycpu"/>
13-
</Target>
1410

1511
<ItemGroup>
16-
<Reference Include="ThermoFisher.CommonCore.Data.dll"/>
17-
<Reference Include="ThermoFisher.CommonCore.MassPrecisionEstimator.dll"/>
18-
<Reference Include="ThermoFisher.CommonCore.RawFileReader.dll"/>
19-
</ItemGroup>
12+
<PackageReference Include="ThermoFisher.CommonCore.BackgroundSubtraction" Version="8.0.6" />
13+
<PackageReference Include="Thermofisher.CommonCore.MassPrecisionEstimator" Version="8.0.6" />
14+
<PackageReference Include="ThermoFisher.CommonCore.RawFileReader" Version="8.0.6" />
15+
</ItemGroup>
2016
</Project>
17+

tests/testthat/test-EH4547.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ test_that("check tic of EH4547", {
2222
expect_equal(length(x$times), length(x$intensities))
2323
expect_equal(length(x$intensities), 995)
2424

25-
expect_true(sum(x$intensities) == 63682815178)
25+
expect_equal(sum(x$intensities), 63682815178, tolerance = 10)
2626
}
2727
})

tests/testthat/test-spectrum.R

+8-5
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ test_that("check readSpectrum scan 23.", {
5050
package = 'rawrr') |>
5151
read.table(sep="\t", header=TRUE)
5252

53-
expect_true(sum(S$mZ %in% DF$m.z) >= 720)
54-
expect_true(sum(S$intensity %in% DF$Intensity) >= 720)
53+
## mono
54+
expect_true(sum(round(S$mZ, 3) %in% round(DF$m.z, 3)) >= 720)
55+
expect_true(sum(round(S$intensity, 3) %in% round(DF$Intensity, 3)) >= 720)
5556

56-
lapply(DF$m.z[DF$Flags == "F"] %in% S$mZ, expect_true)
57-
lapply(DF$m.z[DF$Flags == "M"] %in% S$mZ, expect_true)
58-
lapply(DF$m.z[DF$Flags == "E"] %in% S$mZ, expect_false)
57+
58+
mZ <- round(S$mZ, 3)
59+
lapply(round(DF$m.z[DF$Flags == "F"], 3) %in% mZ, FUN = expect_true)
60+
lapply(round(DF$m.z[DF$Flags == "M"], 3) %in% mZ, FUN = expect_true)
61+
lapply(round(DF$m.z[DF$Flags == "E"], 3) %in% mZ, FUN = expect_false)
5962
})
6063

6164

0 commit comments

Comments
 (0)