Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #458 #460

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class FiltersRenderingTests
{{ 'foo' | contains: 'fo' }}
{{ '\E' | escape_special_chars }}
{{ '\\E' | unescape_special_chars }}
{{ true | is_nan }}
{{ 1 | is_nan }}
{{ -2019.6 | abs }}
{{ 3 | pow: 3 }}
{{ -5 | sign }}
Expand All @@ -28,7 +28,7 @@ public class FiltersRenderingTests
true
\\E
\E
true
false
2019.6
27
-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public class MathFiltersTests
[Fact]
public void IsNaNTest()
{
Assert.True(Filters.IsNaN("2019.6"));
Assert.False(Filters.IsNaN(true));
Assert.False(Filters.IsNaN(string.Empty));
Assert.False(Filters.IsNaN(new Hl7v2Data()));
Assert.False(Filters.IsNan("2019.6"));
Assert.True(Filters.IsNan(true));
Assert.True(Filters.IsNan(string.Empty));
Assert.True(Filters.IsNan(new Hl7v2Data()));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public partial class Filters
{
private static readonly Random RandomGenerator = new Random();

public static bool IsNaN(object data)
public static bool IsNan(object data)
{
return double.TryParse(Convert.ToString(data, CultureInfo.InvariantCulture), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out _);
return !double.TryParse(Convert.ToString(data, CultureInfo.InvariantCulture), NumberStyles.Any, NumberFormatInfo.InvariantInfo, out _);
}

public static double Abs(double data)
Expand Down