MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / test_parse

Method test_parse

tests/PackageManifest_test.cpp:61–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void PackageManifestTest::test_parse()
62{
63 auto manifest = Package::fromManifestContents(basic_manifest);
64 QVERIFY(manifest.valid == true);
65 QVERIFY(manifest.files.size() == 1);
66 QVERIFY(manifest.files.count(Path("a/b.txt")));
67 auto &file = manifest.files[Path("a/b.txt")];
68 QVERIFY(file.executable == true);
69 QVERIFY(file.hash == "da39a3ee5e6b4b0d3255bfef95601890afd80709");
70 QVERIFY(file.size == 0);
71 QVERIFY(manifest.folders.size() == 4);
72 QVERIFY(manifest.folders.count(Path(".")));
73 QVERIFY(manifest.folders.count(Path("a")));
74 QVERIFY(manifest.folders.count(Path("a/b")));
75 QVERIFY(manifest.folders.count(Path("a/b/c")));
76 QVERIFY(manifest.symlinks.size() == 1);
77 auto symlinkPath = Path("a/b/c.txt");
78 QVERIFY(manifest.symlinks.count(symlinkPath));
79 auto &symlink = manifest.symlinks[symlinkPath];
80 QVERIFY(symlink == Path("../b.txt"));
81 QVERIFY(manifest.sources.size() == 1);
82}
83
84void PackageManifestTest::test_parse_file() {
85 auto path = QFINDTESTDATA("testdata/PackageManifest/1.8.0_202-x64.json");

Callers

nothing calls this directly

Calls 3

PathClass · 0.85
sizeMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected