Merge pull request #3476 from sharkdp/docker_syntax_fix

Revert "Bump assets/syntaxes/02_Extra/Docker from `0f6b7bc` to `c001fb2` (#3024)"
This commit is contained in:
Keith Hall authored and GitHub committed 2025-11-26 22:19:06 +02:00
commit c88353b386
5 files changed
+49 -4

No files matched your search

+2 -2
View File
@@ -168,8 +168,8 @@ jobs:
- { target: i686-pc-windows-msvc , os: windows-2025 , } - { target: i686-pc-windows-msvc , os: windows-2025 , }
- { target: i686-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: i686, use-cross: true } - { target: i686-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: i686, use-cross: true }
- { target: i686-unknown-linux-musl , os: ubuntu-latest , dpkg_arch: musl-linux-i686, use-cross: true } - { target: i686-unknown-linux-musl , os: ubuntu-latest , dpkg_arch: musl-linux-i686, use-cross: true }
- { target: x86_64-apple-darwin , os: macos-13, } - { target: x86_64-apple-darwin , os: macos-15-intel, }
- { target: aarch64-apple-darwin , os: macos-14, } - { target: aarch64-apple-darwin , os: macos-latest , }
- { target: x86_64-pc-windows-msvc , os: windows-2025 , } - { target: x86_64-pc-windows-msvc , os: windows-2025 , }
- { target: aarch64-pc-windows-msvc , os: windows-11-arm, } - { target: aarch64-pc-windows-msvc , os: windows-11-arm, }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: amd64, use-cross: true } - { target: x86_64-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: amd64, use-cross: true }
+1
View File
@@ -8,6 +8,7 @@
- Fix hang when using `--list-themes` with an explicit pager, see #3457 (@abhinavcool42) - Fix hang when using `--list-themes` with an explicit pager, see #3457 (@abhinavcool42)
- Fix negative values of N not being parsed in <N:M> line ranges without `=` flag value separator, see #3442 (@lmmx) - Fix negative values of N not being parsed in <N:M> line ranges without `=` flag value separator, see #3442 (@lmmx)
- Fix broken Docker syntax preventing use of custom assets, see #3476 (@keith-hall)
## Other ## Other
- Improve README documentation on pager options passed to less, see #3443 (@injust) - Improve README documentation on pager options passed to less, see #3443 (@injust)
BIN
View File
Binary file not shown.
+45 -1
View File
@@ -1599,7 +1599,7 @@ Clearing metadata file ... okay",
#[cfg(unix)] #[cfg(unix)]
#[test] #[test]
fn cache_build() { fn cache_build_blank() {
let src_dir = "cache_source"; let src_dir = "cache_source";
let tmp_dir = tempdir().expect("can create temporary directory"); let tmp_dir = tempdir().expect("can create temporary directory");
let tmp_themes_path = tmp_dir.path().join("themes.bin"); let tmp_themes_path = tmp_dir.path().join("themes.bin");
@@ -1642,6 +1642,50 @@ Writing metadata to folder .* ... okay",
assert!(tmp_metadata_path.exists()); assert!(tmp_metadata_path.exists());
} }
#[cfg(unix)]
#[test]
fn cache_build() {
let src_dir = "cache_source";
let tmp_dir = tempdir().expect("can create temporary directory");
let tmp_themes_path = tmp_dir.path().join("themes.bin");
let tmp_syntaxes_path = tmp_dir.path().join("syntaxes.bin");
let tmp_acknowledgements_path = tmp_dir.path().join("acknowledgements.bin");
let tmp_metadata_path = tmp_dir.path().join("metadata.yaml");
// Build the cache
// Include the BAT_CONFIG_PATH and BAT_THEME environment variables to ensure that
// options loaded from a config or the environment are not inserted
// before the cache subcommand, which would break it.
bat_with_config()
.current_dir(Path::new(EXAMPLES_DIR).join(src_dir))
.env("BAT_CONFIG_PATH", "bat.conf")
.env("BAT_THEME", "1337")
.arg("cache")
.arg("--build")
// removed --blank
.arg("--source")
.arg(".")
.arg("--target")
.arg(tmp_dir.path().to_str().unwrap())
.arg("--acknowledgements")
.assert()
.success()
.stdout(
predicate::str::is_match(
"Writing theme set to .*/themes.bin ... okay\nWriting syntax set to .*/syntaxes.bin ... okay\nWriting acknowledgements to .*/acknowledgements.bin ... okay\nWriting metadata to folder .* ... okay",
)
.unwrap(),
)
.stdout(predicate::str::contains("Some referenced contexts could not be found!").not())
;
// Now we expect the files to exist. If they exist, we assume contents are correct
assert!(tmp_themes_path.exists());
assert!(tmp_syntaxes_path.exists());
assert!(tmp_acknowledgements_path.exists());
assert!(tmp_metadata_path.exists());
}
#[test] #[test]
fn utf16() { fn utf16() {
// The output will be converted to UTF-8 with the leading UTF-16 // The output will be converted to UTF-8 with the leading UTF-16