mcward_beet 1.2.0
legitimate Minecraft testing plugin
“Beet plugin for Ward, a testing framework for Minecraft datapacks using mcfunction.”
imports Path from pathlibimports pathlib
SHA-256de388f57178e5786f6ee52a2ff38851126cd2ca9c03ea0bab7199bd3838585e4
MaleculeH₂(CmF)
Evidence
1"""Parse test functions with the ward command tree.
2Inspired by https://github.com/CarbonSmasher/packtest-beet/blob/main/packtest_beet/nesting.py"""
3
4import math
5import re
6from dataclasses import dataclass
7from pathlib import Path
8
9from beet import Context, JsonFile
10from tokenstream import TokenStream, set_location
11
12from mcward.beet.plugin import TestFunction
13from mecha import (
14 AstRoot,
15 CompilationDatabase,
16 FileTypeCompilationUnitProvider,
17 Mecha,
18 Parser,
19)
20
21RESOURCES_DIR = Path(__file__).parent / "resources"
22_VERSION = re.compile(
23 r"v?(?P<major>\d+)(?:\.(?P<minor>\d+|[xX*]))?(?:\.(?P< …
28:5… aclass(frozen=True, slots=True)
29class AstTestRoot(AstRoot):
30 """Root of a test file: rules can target it, and bolt won't treat it as a plain module."""
31
32
⋯5 lines
66:75… """
67 trees = {tuple(map(int, p.stem.split("."))): p for p in RESOURCES_DIR.glob("*.json")}
68 target = _parse_version(version)
69
70 if target is None:
⋯5 lines
No evidence locations were recorded for this file. Raw result