Skip to content

Commit 08b8cca

Browse files
committed
Add test RZX file
1 parent 1df97c5 commit 08b8cca

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/Spectron.Files/Extensions/BytesExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal static string ToAsciiString(this IEnumerable<byte> bytes)
1010

1111
foreach (var b in bytes)
1212
{
13-
if (b == 0)
13+
if (b is < 32 or > 126)
1414
{
1515
continue;
1616
}

tests/Spectron.Files.Tests/Rzx/RzxFileTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ public class RzxFileTests
88
[Fact]
99
public void RzxFile_ShouldLoad()
1010
{
11-
using var file = LoadTestFile("manic.rzx");
11+
using var file = LoadTestFile("test.rzx");
1212
var rzxFile = RzxFile.Load(file);
1313

14-
rzxFile.Creator?.CreatorName.ShouldBe("SPIN");
15-
rzxFile.Creator?.MajorVersion.ShouldBe(0);
16-
rzxFile.Creator?.MinorVersion.ShouldBe(3);
14+
rzxFile.Creator?.CreatorName.ShouldBe("SpectaculatorD");
15+
rzxFile.Creator?.MajorVersion.ShouldBe(52);
16+
rzxFile.Creator?.MinorVersion.ShouldBe(371);
1717

1818
rzxFile.Snapshots.ShouldHaveSingleItem();
19-
rzxFile.Snapshots[0].Extension.ShouldBe("Z80");
19+
rzxFile.Snapshots[0].Extension.ShouldBe("z80");
20+
21+
rzxFile.Snapshots[0].Recording.ShouldNotBeNull();
22+
rzxFile.Snapshots[0].Recording!.Frames.Count.ShouldBe(21381);
2023
}
2124

2225
private static FileStream LoadTestFile(string fileName)
32.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)