Skip to content

Commit

Permalink
Fix list truncation format
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Oct 18, 2023
1 parent c4aef60 commit 9b5925a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions src/ConfigCat.Client.Tests/ConfigCat.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'net461'">
<When Condition="'$(TargetFramework)' == 'net6.0'">
<ItemGroup>
<!-- DynamicData matrix tests won't show up in VS 2022 using MSTest.TestAdapter v2.2.10.
It seems we'd need v3.x to make that work. But v3.x supports .NET 4.6.2+ only... :S
TODO: upgrade to v3.x when when we drop support for .NET 4.6.1 and earlier. -->
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
It seems we'd need v3.x to make that work. But v3.x supports .NET 4.6.2+ only...
However, as test discovery may be pretty slow because of the large number of test cases,
it's usually sufficient to see separate test results for only one of the target frameworks,
so we enable v3.x on .NET 6 only. -->
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
</ItemGroup>
</When>

<Otherwise>
<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
</ItemGroup>
</Otherwise>
</Choose>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INFO [5000] Evaluating 'booleanKey1' for User '{"Identifier":"12"}'
Evaluating targeting rules and applying the first match if any:
- IF User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] => true
AND User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ... <1 more value>] => true
AND User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ... <2 more values>] => true
AND User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', ... <1 more value>] => true
AND User.Identifier CONTAINS ANY OF ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', ... <2 more values>] => true
THEN 'True' => MATCH, applying rule
Returning 'True'.
2 changes: 1 addition & 1 deletion src/ConfigCatClient/Evaluation/EvaluateLogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static IndentedTextBuilder AppendUserCondition(this IndentedTextBuilder
else
{
var comparisonValueFormatter = new StringListFormatter(comparisonValue, StringListMaxLength, getOmittedItemsText: static count =>
string.Format(CultureInfo.InvariantCulture, " ... <{0} more {1}>", count, count == 1 ? valueText : valuesText));
$", ... <{count.ToString(CultureInfo.InvariantCulture)} more {(count == 1 ? valueText : valuesText)}>");

return builder.Append($"User.{comparisonAttribute} {comparator.ToDisplayText()} [{comparisonValueFormatter}]");
}
Expand Down

0 comments on commit 9b5925a

Please sign in to comment.