Skip to content

Commit 107ceab

Browse files
committed
Squashed commit of the following:
commit 59467cb Merge: 23cb1cb 3bc00df Author: Nathanial P. Howard <admin@optimuspi.com> Date: Mon Aug 18 00:16:54 2025 -0500 um commit 23cb1cb Author: Nathanial P. Howard <admin@optimuspi.com> Date: Mon Aug 18 00:15:06 2025 -0500 ope commit 3bc00df Author: Tacodiva <27910867+Tacodiva@users.noreply.github.com> Date: Mon Aug 18 15:11:43 2025 +1000 Refector new code commit 96ca0eb Author: Nathanial P. Howard <admin@optimuspi.com> Date: Mon Aug 18 00:01:20 2025 -0500 yikes commit 7f60356 Merge: 9989227 c5d1da6 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 17 23:42:09 2025 -0500 ok commit 51d0d46 Author: Tacodiva <27910867+Tacodiva@users.noreply.github.com> Date: Mon Aug 18 14:20:54 2025 +1000 Format code commit 9989227 Merge: a6b8906 9ada071 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 17 23:15:30 2025 -0500 um commit a6b8906 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 17 19:16:57 2025 -0500 og motely but with fixes commit 8f575cf Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 17 18:57:38 2025 -0500 slap motely back on w/ fixes commit 7f31f36 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 17 18:31:13 2025 -0500 why the F doesnt this work bruh commit 4c718b8 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Fri Aug 15 12:57:07 2025 -0500 fix matching black hole commit 52d0106 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Fri Aug 15 11:54:42 2025 -0500 packSlotOVerrrides commit cd1afbd Author: Nathanial P. Howard <admin@optimuspi.com> Date: Fri Aug 15 01:17:01 2025 -0500 Update MotelyVectorUtils.cs commit f603705 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Fri Aug 15 01:15:30 2025 -0500 pifreak loves tacodiva commit b0dc648 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Thu Aug 14 22:37:46 2025 -0500 tyeet commit 68ab9c6 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Thu Aug 14 12:33:41 2025 -0500 Add min and stickers, fix an analyzer function commit add1246 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Wed Aug 13 21:37:50 2025 -0500 lil faster commit e17a0d2 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Wed Aug 13 20:04:58 2025 -0500 fix % and ETA OMG !!!!!!!!!!!!! commit 0eb1be9 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Wed Aug 13 16:58:42 2025 -0500 Fix auto cutoff and debug logging commit 198526b Author: Nathanial P. Howard <admin@optimuspi.com> Date: Tue Aug 12 23:57:26 2025 -0500 Update OuijaJsonFilterDesc.cs commit a083e26 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Tue Aug 12 14:51:31 2025 -0500 add a better auto cutoff commit 6b21cf0 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Tue Aug 12 14:35:01 2025 -0500 Throttle and enum matching commit 5e9bda5 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Mon Aug 11 22:23:10 2025 -0500 Try to fallback support non-AVX SIMD (for apple silicon) commit e0fcb98 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Mon Aug 11 16:06:31 2025 -0500 Update Program.cs commit 812345f Author: Nathanial P. Howard <admin@optimuspi.com> Date: Mon Aug 11 15:54:04 2025 -0500 Trying a new clean way, .WithProgress commit 3a14f89 Merge: 55d8f59 8089d97 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 10 17:31:00 2025 -0500 update commit 55d8f59 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 10 17:26:56 2025 -0500 fix build commit 38ab319 Author: Nathanial P. Howard <admin@optimuspi.com> Date: Sun Aug 10 17:18:26 2025 -0500 Update .gitignore
1 parent c5d1da6 commit 107ceab

File tree

92 files changed

+4649
-4417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4649
-4417
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
bin
22
obj
3+
/JsonItemFilters
34
/WordLists
45
*.csv
6+
/WordLists
57
/JsonItemFilters

CLAUDE.local.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

JsonItemFilters/pi.ouija.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

JsonItemFilters/test-any-negative-need.ouija.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

JsonItemFilters/test_any_soul.ouija.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

JsonItemFilters/test_soul_charm.ouija.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

JsonItemFilters/test_spectral_shop_only.ouija.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

JsonItemFilters/test_spectral_soul.ouija.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

Motely.Tests/AnalyzerUnitTests.cs

Lines changed: 140 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,56 @@
1-
using static VerifyXunit.Verifier;
2-
3-
namespace Motely.Tests;
4-
5-
public sealed class AnalyzerUnitTests
1+
using System;
2+
using System.IO;
3+
using System.Text;
4+
using System.Threading.Tasks;
5+
using Xunit;
6+
using VerifyXunit;
7+
8+
namespace Motely.Tests
69
{
7-
8-
[Fact]
9-
public async Task TestAnalyzer_UNITTEST_Seed()
10+
public class AnalyzerUnitTests
1011
{
12+
[Fact]
13+
public async Task TestAnalyzer_UNITTEST_Seed()
14+
{
15+
// Arrange
16+
string seed = "UNITTEST";
17+
18+
// Act
19+
var actualOutput = GetAnalyzerOutput(seed);
20+
21+
// Assert using Verify - this will create a nice diff view
22+
await Verify(actualOutput)
23+
.UseFileName($"analyzer_output_{seed}")
24+
.DisableRequireUniquePrefix();
25+
}
26+
27+
[Fact]
28+
public async Task TestAnalyzer_ALEEB_Seed()
29+
{
30+
// Arrange
31+
string seed = "ALEEB";
32+
33+
// Act
34+
var actualOutput = GetAnalyzerOutput(seed);
35+
36+
// Assert using Verify - this will create a nice diff view
37+
await Verify(actualOutput)
38+
.UseFileName($"analyzer_output_{seed}")
39+
.DisableRequireUniquePrefix();
40+
}
41+
42+
private string GetAnalyzerOutput(string seed)
43+
{
44+
// Capture console output
45+
var originalOut = Console.Out;
46+
var stringWriter = new StringWriter();
47+
Console.SetOut(stringWriter);
48+
49+
try
1150
// Arrange
1251
string seed = "UNITTEST";
1352

14-
53+
1554

1655
// Act
1756
var actualOutput = GetAnalyzerOutput(seed);
@@ -39,24 +78,7 @@ await Verify(actualOutput)
3978

4079
private string GetAnalyzerOutput(string seed)
4180
{
42-
// Capture console output
43-
var originalOut = Console.Out;
44-
var stringWriter = new StringWriter();
45-
Console.SetOut(stringWriter);
46-
47-
try
48-
{
49-
// Run the analyzer
50-
SeedAnalyzer.AnalyzeToConsole(seed, MotelyDeck.Red, MotelyStake.White);
51-
52-
// Get the output
53-
return stringWriter.ToString();
54-
}
55-
finally
56-
{
57-
// Restore console output
58-
Console.SetOut(originalOut);
59-
}
81+
return SeedAnalyzer.Analyze(new(seed, MotelyDeck.Red, MotelyStake.White)).ToString();
6082
}
6183

6284
// This method is now only used by other tests that don't use Verify yet
@@ -81,68 +103,104 @@ private void AssertOutputsMatch(string expected, string actual, string seed)
81103

82104
if (expectedLine != actualLine)
83105
{
84-
// Provide detailed error message showing the difference
85-
var message = $"Seed {seed} - Line {i + 1} mismatch:\n" +
86-
$"Expected: {expectedLine}\n" +
87-
$"Actual: {actualLine}";
88-
Assert.Fail(message);
106+
// Run the analyzer
107+
SeedAnalyzer.AnalyzeToConsole(seed, MotelyDeck.Red, MotelyStake.White);
108+
109+
// Get the output
110+
return stringWriter.ToString();
89111
}
90-
}
91-
}
92-
93-
[Fact]
94-
public void TestAnalyzer_PackContentsFormat()
95-
{
96-
// Test that pack contents are formatted correctly
97-
string seed = "UNITTEST";
98-
var output = GetAnalyzerOutput(seed);
99-
100-
// Check that packs have the correct format: "Pack Name - Card1, Card2"
101-
Assert.Contains("Buffoon Pack - ", output);
102-
Assert.Contains("Arcana Pack - ", output);
103-
Assert.Contains("Standard Pack - ", output);
104-
105-
// Check that Mega packs DON'T have the "(pick 2)" suffix (Immolate doesn't use it)
106-
Assert.Contains("Mega Standard Pack - ", output);
107-
Assert.Contains("Mega Arcana Pack - ", output);
108-
Assert.Contains("Mega Celestial Pack - ", output);
109-
}
110-
111-
[Fact]
112-
public void TestAnalyzer_TagsNotActivated()
113-
{
114-
// Test that tags are just listed, not "activated" to show their packs
115-
string seed = "UNITTEST";
116-
var output = GetAnalyzerOutput(seed);
117-
118-
// Check first ante has Speed Tags but no extra packs from them
119-
var lines = output.Split('\n');
120-
bool inAnte1 = false;
121-
int packCount = 0;
122-
123-
foreach (var line in lines)
124-
{
125-
if (line.Contains("==ANTE 1=="))
112+
finally
126113
{
127-
inAnte1 = true;
114+
// Restore console output
115+
Console.SetOut(originalOut);
128116
}
129-
else if (line.Contains("==ANTE 2=="))
117+
}
118+
119+
// This method is now only used by other tests that don't use Verify yet
120+
private void AssertOutputsMatch(string expected, string actual, string seed)
121+
{
122+
// Normalize line endings
123+
expected = expected.Replace("\r\n", "\n").Trim();
124+
actual = actual.Replace("\r\n", "\n").Trim();
125+
126+
// Split into lines for detailed comparison
127+
var expectedLines = expected.Split('\n');
128+
var actualLines = actual.Split('\n');
129+
130+
// First check line count
131+
Assert.Equal(expectedLines.Length, actualLines.Length);
132+
133+
// Compare line by line for better error messages
134+
for (int i = 0; i < expectedLines.Length; i++)
130135
{
131-
break;
136+
var expectedLine = expectedLines[i].TrimEnd();
137+
var actualLine = actualLines[i].TrimEnd();
138+
139+
if (expectedLine != actualLine)
140+
{
141+
// Provide detailed error message showing the difference
142+
var message = $"Seed {seed} - Line {i + 1} mismatch:\n" +
143+
$"Expected: {expectedLine}\n" +
144+
$"Actual: {actualLine}";
145+
Assert.Fail(message);
146+
}
132147
}
133-
else if (inAnte1 && line.Trim().StartsWith("Buffoon Pack") ||
134-
line.Trim().StartsWith("Arcana Pack") ||
135-
line.Trim().StartsWith("Celestial Pack") ||
136-
line.Trim().StartsWith("Spectral Pack") ||
137-
line.Trim().StartsWith("Standard Pack") ||
138-
line.Trim().StartsWith("Jumbo") ||
139-
line.Trim().StartsWith("Mega"))
148+
}
149+
150+
[Fact]
151+
public void TestAnalyzer_PackContentsFormat()
152+
{
153+
// Test that pack contents are formatted correctly
154+
string seed = "UNITTEST";
155+
var output = GetAnalyzerOutput(seed);
156+
157+
// Check that packs have the correct format: "Pack Name - Card1, Card2"
158+
Assert.Contains("Buffoon Pack - ", output);
159+
Assert.Contains("Arcana Pack - ", output);
160+
Assert.Contains("Standard Pack - ", output);
161+
162+
// Check that Mega packs DON'T have the "(pick 2)" suffix (Immolate doesn't use it)
163+
Assert.Contains("Mega Standard Pack - ", output);
164+
Assert.Contains("Mega Arcana Pack - ", output);
165+
Assert.Contains("Mega Celestial Pack - ", output);
166+
}
167+
168+
[Fact]
169+
public void TestAnalyzer_TagsNotActivated()
170+
{
171+
// Test that tags are just listed, not "activated" to show their packs
172+
string seed = "UNITTEST";
173+
var output = GetAnalyzerOutput(seed);
174+
175+
// Check first ante has Speed Tags but no extra packs from them
176+
var lines = output.Split('\n');
177+
bool inAnte1 = false;
178+
int packCount = 0;
179+
180+
foreach (var line in lines)
140181
{
141-
packCount++;
182+
if (line.Contains("==ANTE 1=="))
183+
{
184+
inAnte1 = true;
185+
}
186+
else if (line.Contains("==ANTE 2=="))
187+
{
188+
break;
189+
}
190+
else if (inAnte1 && line.Trim().StartsWith("Buffoon Pack") ||
191+
line.Trim().StartsWith("Arcana Pack") ||
192+
line.Trim().StartsWith("Celestial Pack") ||
193+
line.Trim().StartsWith("Spectral Pack") ||
194+
line.Trim().StartsWith("Standard Pack") ||
195+
line.Trim().StartsWith("Jumbo") ||
196+
line.Trim().StartsWith("Mega"))
197+
{
198+
packCount++;
199+
}
142200
}
201+
202+
// Ante 1 should have exactly 4 packs
203+
Assert.Equal(4, packCount);
143204
}
144-
145-
// Ante 1 should have exactly 4 packs
146-
Assert.Equal(4, packCount);
147205
}
148206
}

0 commit comments

Comments
 (0)