Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/i18n/ar/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ python -I make_game.py --game "D:\path\to\package" --out "D:\Games\Leonida" --wo

يعمل `make_game.py` على Linux، ويجد `llvm-mc` تلقائيًا إذا كان ضمن `PATH`. تأكد من أن نسخته تدعم AMDGPU.
يعمل محمّل اللعبة، وهو برنامج Windows، عبر Wine أو Proton. إذا كان لديك بناء Windows جاهز للمحمّل،
فمرّر مجلده باستخدام `--runtime-build`. راجع [تعليمات البناء والتشغيل على Linux](../../../README.md#running-the-loader-on-linux).
فمرّر مجلده باستخدام `--runtime-build`. راجع [تعليمات البناء والتشغيل على Linux](../../linux.md).

## حل المشاكل الشائعة

Expand Down
4 changes: 2 additions & 2 deletions scripts/windows-boot/test_crash_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def check_artifacts(self, code, exception):
streams = dict((kind, pos) for kind, size, pos in
(struct.unpack_from("<III", data, offset + 12*i) for i in range(count)))
self.assertIn(3, streams) # ThreadListStream
trace = (self.report / "stack.txt").read_text()
trace = (self.report / "stack.txt").read_text(encoding="utf-8")
self.assertIn(f"code=0x{code:08x}", trace)
if exception:
pos = streams[6] # ExceptionStream: thread ID, padding, exception record
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_existing_directory(self):
sentinel.write_bytes(b"original")
self.assertNotEqual(self.run_fixture("worker"), 0)
self.assertEqual(list(self.report.iterdir()), [sentinel])
self.assertEqual(sentinel.read_text(), "original")
self.assertEqual(sentinel.read_text(encoding="utf-8"), "original")

def test_repo_rejected(self):
self.report = REPO / (self.report.parent.name + "-forbidden")
Expand Down
10 changes: 10 additions & 0 deletions tests/test_docs_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
INLINE_CODE = re.compile(r"(?<!`)(`+)(?!`)[^\r\n]*?(?<!`)\1(?!`)")
HTML = re.compile(r'(?:href|src)\s*=\s*"([^"]+)"')
HEADING = re.compile(r"^(#{1,6})\s+(.*?)\s*#*\s*$", re.M)
# An explicit anchor (<a id="..."> or <a name="...">), kept when a heading is renamed so old links still land.
HTML_ANCHOR = re.compile(r"<a\s[^>]*\b(?:id|name)\s*=\s*[\"']([^\"']+)[\"']", re.I)
EXTERNAL = ("http://", "https://", "mailto:", "tel:", "data:")


Expand Down Expand Up @@ -103,6 +105,7 @@ def anchors(path):
count = seen.get(base, 0)
seen[base] = count + 1
found.add(base if count == 0 else f"{base}-{count}")
found.update(HTML_ANCHOR.findall(text))
return found


Expand Down Expand Up @@ -249,6 +252,13 @@ def test_heading_after_inline_backticks_is_an_anchor(self):
f.write("Use ```code``` inline.\n\n## Real heading\n\n```\n## Not a heading\n```\n")
self.assertEqual(anchors(page), {"real-heading"})

def test_explicit_html_anchor_is_an_anchor(self):
with tempfile.TemporaryDirectory() as tmp:
page = os.path.join(tmp, "page.md")
with open(page, "w", encoding="utf-8") as f:
f.write('<a id="project-status"></a>\n\n## Where it stands\n\n<a name="old-name"></a>\n')
self.assertEqual(anchors(page), {"project-status", "where-it-stands", "old-name"})


class RepositoryLinksTest(unittest.TestCase):
def test_checks_referenced_definitions_but_not_unused_ones(self):
Expand Down
Loading