diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-01 23:05:23 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-01 23:05:51 +0300 |
| commit | 5bd21b7ed468b5ff4d1a5b2ed7e211f401eb138a (patch) | |
| tree | 672fa4625cca0ecb3e9376fc7f8e33d7b0e9deef /scripts/test_vendor_libghostty_vt.py | |
| parent | 32abb3776668ee768200019c170956f67fe33a86 (diff) | |
chore: update libghostty vendor
refs #276
Diffstat (limited to 'scripts/test_vendor_libghostty_vt.py')
| -rw-r--r-- | scripts/test_vendor_libghostty_vt.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/test_vendor_libghostty_vt.py b/scripts/test_vendor_libghostty_vt.py index a26bd204..d73a3477 100644 --- a/scripts/test_vendor_libghostty_vt.py +++ b/scripts/test_vendor_libghostty_vt.py @@ -5,8 +5,9 @@ import tarfile import tempfile import unittest from pathlib import Path +from unittest import mock -from scripts.vendor_libghostty_vt import parse_archive_root +from scripts.vendor_libghostty_vt import ensure_dist_archive, parse_archive_root class VendorLibghosttyVtTests(unittest.TestCase): @@ -21,6 +22,23 @@ class VendorLibghosttyVtTests(unittest.TestCase): self.assertEqual(parse_archive_root(archive), "libghostty-vt-1.0.0") + def test_ensure_dist_archive_refuses_stale_archives_without_head_match(self) -> None: + with tempfile.TemporaryDirectory() as temp_dir: + repo = Path(temp_dir) + dist = repo / "zig-out" / "dist" + dist.mkdir(parents=True) + (dist / "libghostty-vt-1.3.2-main-+deadbeef0.tar.gz").write_bytes(b"stale") + + with ( + mock.patch("scripts.vendor_libghostty_vt.subprocess.run"), + mock.patch( + "scripts.vendor_libghostty_vt.subprocess.check_output", + return_value="0123456789abcdef\n", + ), + ): + with self.assertRaisesRegex(FileNotFoundError, "HEAD 012345678"): + ensure_dist_archive(repo) + def test_vendored_tree_contains_required_upstream_files(self) -> None: root = Path(__file__).resolve().parent.parent / "vendor" / "libghostty-vt" required = [ |
