1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 03:12:25 +01:00

Merge branch 'master' into read-from-tail

This commit is contained in:
Keith Hall
2025-04-15 20:27:26 +03:00
130 changed files with 3567 additions and 1099 deletions

0
tests/examples/test.A—B가 vendored Normal file
View File

View File

@@ -35,13 +35,7 @@ fn all_jobs_not_missing_any_jobs() {
.as_mapping()
.unwrap()
.keys()
.filter_map(|k| {
if exceptions.contains(&k.as_str().unwrap_or_default()) {
None
} else {
Some(k)
}
})
.filter(|k| !exceptions.contains(&k.as_str().unwrap_or_default()))
.map(ToOwned::to_owned)
.collect::<Vec<_>>();

View File

@@ -9,7 +9,6 @@ use tempfile::tempdir;
mod unix {
pub use std::fs::File;
pub use std::io::{self, Write};
pub use std::os::unix::io::FromRawFd;
pub use std::path::PathBuf;
pub use std::process::Stdio;
pub use std::thread;
@@ -314,11 +313,8 @@ fn squeeze_limit_line_numbers() {
#[test]
fn list_themes_with_colors() {
#[cfg(target_os = "macos")]
let default_theme_chunk = "Monokai Extended Light\x1B[0m (default)";
#[cfg(not(target_os = "macos"))]
let default_theme_chunk = "Monokai Extended\x1B[0m (default)";
let default_light_theme_chunk = "Monokai Extended Light\x1B[0m (default light)";
bat()
.arg("--color=always")
@@ -327,34 +323,50 @@ fn list_themes_with_colors() {
.success()
.stdout(predicate::str::contains("DarkNeon").normalize())
.stdout(predicate::str::contains(default_theme_chunk).normalize())
.stdout(predicate::str::contains(default_light_theme_chunk).normalize())
.stdout(predicate::str::contains("Output the square of a number.").normalize());
}
#[test]
fn list_themes_without_colors() {
#[cfg(target_os = "macos")]
let default_theme_chunk = "Monokai Extended Light (default)";
#[cfg(not(target_os = "macos"))]
let default_theme_chunk = "Monokai Extended (default)";
let default_light_theme_chunk = "Monokai Extended Light (default light)";
bat()
.arg("--color=never")
.arg("--decorations=always") // trick bat into setting `Config::loop_through` to false
.arg("--list-themes")
.assert()
.success()
.stdout(predicate::str::contains("DarkNeon").normalize())
.stdout(predicate::str::contains(default_theme_chunk).normalize());
.stdout(predicate::str::contains(default_theme_chunk).normalize())
.stdout(predicate::str::contains(default_light_theme_chunk).normalize());
}
#[test]
#[cfg_attr(any(not(feature = "git"), target_os = "windows"), ignore)]
fn list_themes_to_piped_output() {
bat().arg("--list-themes").assert().success().stdout(
predicate::str::contains("(default)")
.not()
.and(predicate::str::contains("(default light)").not())
.and(predicate::str::contains("(default dark)").not()),
);
}
#[test]
#[cfg_attr(
any(not(feature = "git"), feature = "lessopen", target_os = "windows"),
ignore
)]
fn short_help() {
test_help("-h", "../doc/short-help.txt");
}
#[test]
#[cfg_attr(any(not(feature = "git"), target_os = "windows"), ignore)]
#[cfg_attr(
any(not(feature = "git"), feature = "lessopen", target_os = "windows"),
ignore
)]
fn long_help() {
test_help("--help", "../doc/long-help.txt");
}
@@ -445,9 +457,10 @@ fn no_args_doesnt_break() {
// as the slave end of a pseudo terminal. Although both point to the same "file", bat should
// not exit, because in this case it is safe to read and write to the same fd, which is why
// this test exists.
let OpenptyResult { master, slave } = openpty(None, None).expect("Couldn't open pty.");
let mut master = unsafe { File::from_raw_fd(master) };
let stdin_file = unsafe { File::from_raw_fd(slave) };
let mut master = File::from(master);
let stdin_file = File::from(slave);
let stdout_file = stdin_file.try_clone().unwrap();
let stdin = Stdio::from(stdin_file);
let stdout = Stdio::from(stdout_file);
@@ -455,6 +468,7 @@ fn no_args_doesnt_break() {
let mut child = bat_raw_command()
.stdin(stdin)
.stdout(stdout)
.env("TERM", "dumb") // Suppresses color detection
.spawn()
.expect("Failed to start.");
@@ -1050,6 +1064,31 @@ fn enable_pager_if_pp_flag_comes_before_paging() {
.stdout(predicate::eq("pager-output\n").normalize());
}
#[test]
fn paging_does_not_override_simple_plain() {
bat()
.env("PAGER", "echo pager-output")
.arg("--decorations=always")
.arg("--plain")
.arg("--paging=never")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("hello world\n"));
}
#[test]
fn simple_plain_does_not_override_paging() {
bat()
.env("PAGER", "echo pager-output")
.arg("--paging=always")
.arg("--plain")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("pager-output\n"));
}
#[test]
fn pager_failed_to_parse() {
bat()
@@ -1601,6 +1640,17 @@ oken
.stderr("");
}
#[test]
fn header_narrow_terminal_with_multibyte_chars() {
bat()
.arg("--terminal-width=30")
.arg("--decorations=always")
.arg("test.A—B가")
.assert()
.success()
.stderr("");
}
#[test]
#[cfg(feature = "git")] // Expected output assumes git is enabled
fn header_default() {
@@ -1833,7 +1883,7 @@ fn do_not_panic_regression_tests() {
] {
bat()
.arg("--color=always")
.arg(&format!("regression_tests/{filename}"))
.arg(format!("regression_tests/{filename}"))
.assert()
.success();
}
@@ -1846,7 +1896,7 @@ fn do_not_detect_different_syntax_for_stdin_and_files() {
let cmd_for_file = bat()
.arg("--color=always")
.arg("--map-syntax=*.js:Markdown")
.arg(&format!("--file-name={file}"))
.arg(format!("--file-name={file}"))
.arg("--style=plain")
.arg(file)
.assert()
@@ -1856,7 +1906,7 @@ fn do_not_detect_different_syntax_for_stdin_and_files() {
.arg("--color=always")
.arg("--map-syntax=*.js:Markdown")
.arg("--style=plain")
.arg(&format!("--file-name={file}"))
.arg(format!("--file-name={file}"))
.pipe_stdin(Path::new(EXAMPLES_DIR).join(file))
.unwrap()
.assert()
@@ -1875,7 +1925,7 @@ fn no_first_line_fallback_when_mapping_to_invalid_syntax() {
bat()
.arg("--color=always")
.arg("--map-syntax=*.invalid-syntax:InvalidSyntax")
.arg(&format!("--file-name={file}"))
.arg(format!("--file-name={file}"))
.arg("--style=plain")
.arg(file)
.assert()
@@ -1969,6 +2019,16 @@ fn show_all_with_unicode() {
.stderr("");
}
#[test]
fn binary_as_text() {
bat()
.arg("--binary=as-text")
.arg("control_characters.txt")
.assert()
.stdout("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F")
.stderr("");
}
#[test]
fn no_paging_arg() {
bat()
@@ -2257,6 +2317,46 @@ fn theme_arg_overrides_env_withconfig() {
.stderr("");
}
#[test]
fn theme_light_env_var_is_respected() {
bat()
.env("BAT_THEME_LIGHT", "Coldark-Cold")
.env("COLORTERM", "truecolor")
.arg("--theme=light")
.arg("--paging=never")
.arg("--color=never")
.arg("--terminal-width=80")
.arg("--wrap=never")
.arg("--decorations=always")
.arg("--style=plain")
.arg("--highlight-line=1")
.write_stdin("Lorem Ipsum")
.assert()
.success()
.stdout("\x1B[48;2;208;218;231mLorem Ipsum\x1B[0m")
.stderr("");
}
#[test]
fn theme_dark_env_var_is_respected() {
bat()
.env("BAT_THEME_DARK", "Coldark-Dark")
.env("COLORTERM", "truecolor")
.arg("--theme=dark")
.arg("--paging=never")
.arg("--color=never")
.arg("--terminal-width=80")
.arg("--wrap=never")
.arg("--decorations=always")
.arg("--style=plain")
.arg("--highlight-line=1")
.write_stdin("Lorem Ipsum")
.assert()
.success()
.stdout("\x1B[48;2;33;48;67mLorem Ipsum\x1B[0m")
.stderr("");
}
#[test]
fn theme_env_overrides_config() {
bat_with_config()
@@ -2435,7 +2535,6 @@ fn lessopen_stdin_piped() {
#[cfg(unix)] // Expected output assumed that tests are run on a Unix-like system
#[cfg(feature = "lessopen")]
#[test]
#[serial] // Randomly fails otherwise
fn lessopen_and_lessclose_file_temp() {
// This is mainly to test that $LESSCLOSE gets passed the correct file paths
// In this case, the original file and the temporary file returned by $LESSOPEN
@@ -2453,7 +2552,6 @@ fn lessopen_and_lessclose_file_temp() {
#[cfg(unix)] // Expected output assumed that tests are run on a Unix-like system
#[cfg(feature = "lessopen")]
#[test]
#[serial] // Randomly fails otherwise
fn lessopen_and_lessclose_file_piped() {
// This is mainly to test that $LESSCLOSE gets passed the correct file paths
// In these cases, the original file and a dash
@@ -2480,8 +2578,6 @@ fn lessopen_and_lessclose_file_piped() {
#[cfg(unix)] // Expected output assumed that tests are run on a Unix-like system
#[cfg(feature = "lessopen")]
#[test]
#[serial] // Randomly fails otherwise
#[ignore = "randomly failing on some systems"]
fn lessopen_and_lessclose_stdin_temp() {
// This is mainly to test that $LESSCLOSE gets passed the correct file paths
// In this case, a dash and the temporary file returned by $LESSOPEN
@@ -2499,7 +2595,6 @@ fn lessopen_and_lessclose_stdin_temp() {
#[cfg(unix)] // Expected output assumed that tests are run on a Unix-like system
#[cfg(feature = "lessopen")]
#[test]
#[serial] // Randomly fails otherwise
fn lessopen_and_lessclose_stdin_piped() {
// This is mainly to test that $LESSCLOSE gets passed the correct file paths
// In these cases, two dashes

View File

@@ -12,13 +12,15 @@ def compare_highlighted_versions(root_old, root_new):
print(" -", root_old)
print(" -", root_new)
has_changes = False
# Used to check for newly added files that don't have a test
unknown_files = {strip_root(p) for p in glob.glob(path.join(root_new, "*", "*"))}
for path_old in glob.glob(path.join(root_old, "*", "*")):
filename = path.basename(path_old)
dirname = path.basename(path.dirname(path_old))
rel_path = strip_root(path_old)
unknown_files.discard(rel_path)
path_new = path.join(root_new, rel_path)
path_new = path.join(root_new, dirname, filename)
print("\n========== {}/{}".format(dirname, filename))
print("\n========== {}".format(rel_path))
with open(path_old) as file_old:
lines_old = file_old.readlines()
@@ -39,11 +41,21 @@ def compare_highlighted_versions(root_old, root_new):
has_changes = True
else:
print("No changes")
print()
for f in unknown_files:
print("\n========== {}: No fixture for this language, run update.sh".format(f))
has_changes = True
print()
return has_changes
def strip_root(p: str) -> str:
filename = path.basename(p)
dirname = path.basename(path.dirname(p))
return path.join(dirname, filename)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="This script compares two directories that were created "

View File

@@ -0,0 +1,3 @@
foo,bar,baz,this|that,test,colors,cycle
1.2,1.7,2.5,blah;cool,test,colors,cycle
1 foo bar baz this|that test colors cycle
2 1.2 1.7 2.5 blah;cool test colors cycle

View File

@@ -1,7 +1,7 @@
first,last,address,city,zip
John,Doe,120 any st.,"Anytown, WW",08123
a,b
1,"ha 
first,last,address,city,zip
John,Doe,120 any st.,"Anytown, WW",08123
a,b
1,"ha 
""ha"" 
ha",120 any st.,"Anytown, WW",08123
3,4,120 any st.,"Anytown, WW",08123
ha",120 any st.,"Anytown, WW",08123
3,4,120 any st.,"Anytown, WW",08123
Can't render this file because it contains an unexpected character in line 2 and column 177.

View File

@@ -0,0 +1,3 @@
foo|bar|baz
1,2|1,7|2,7
1,5|8,5|-5,5
1 [3 38 2 253 151 31mfoo[38 2 253 151 31m|[38 2 102 217 239mbar[38 2 253 151 31m|[38 2 190 132 255mbaz
2 [3 38 2 253 151 31m1,2[38 2 253 151 31m|[38 2 102 217 239m1,7[38 2 253 151 31m|[38 2 190 132 255m2,7
3 [3 38 2 253 151 31m1,5[38 2 253 151 31m|[38 2 102 217 239m8,5[38 2 253 151 31m|[38 2 190 132 255m-5,5

View File

@@ -0,0 +1,3 @@
foo;bar;baz
1,2;1,7;2,7
1,5;8,5;-5,5
1 [3 38 2 253 151 31mfoo[38 2 253 151 31m [38 2 102 217 239mbar[38 2 253 151 31m [38 2 190 132 255mbaz
2 [3 38 2 253 151 31m1,2[38 2 253 151 31m [38 2 102 217 239m1,7[38 2 253 151 31m [38 2 190 132 255m2,7
3 [3 38 2 253 151 31m1,5[38 2 253 151 31m [38 2 102 217 239m8,5[38 2 253 151 31m [38 2 190 132 255m-5,5

View File

@@ -0,0 +1,3 @@
foo bar baz|;, test hello world tsv
1,2 1,7 2,7 a b c "hello again" tsv
";|," ;|, baz test "hello world" tsv
Can't render this file because it contains an unexpected character in line 2 and column 218.

View File

@@ -0,0 +1,71 @@
extends Node
signal custom_signal(param)
const PI = 3.14159
var untyped_var = "Hello, World!"
var typed_int: int = 42
var typed_float: float = 3.14
var typed_string: String = "GDScript Test"
var typed_array: Array = [1, 2, 3, 4]
var typed_dict: Dictionary = {"key": "value", "number": 100}
onready var label = $Label
func say_hello() -> void:
 print("Hello from GDScript!")
func add_numbers(a: int, b: int = 10) -> int:
 return a + b
func process_value(value: int) -> String:
 if value < 0:
 return "Negative"
 elif value == 0:
 return "Zero"
 else:
 return "Positive"
func sum_array(arr: Array) -> int:
 var total: int = 0
 for num in arr:
 total += num
 return total
func describe_number(num: int) -> String:
 match num:
 0:
 return "Zero"
 1, 2, 3:
 return "Small number"
 _:
 return "Large number"
func long_description() -> String:
 return """This is a test file for GDScript.
It covers variables, functions, control structures, loops, signals, inner classes,
multiline strings, arrays, and dictionaries."""
class InnerExample:
 var inner_value: int = 99
 func show_value() -> void:
 print("Inner value is:", inner_value)
func test_inner_class() -> void:
 var inner = InnerExample.new()
 inner.show_value()
func trigger_signal() -> void:
 emit_signal("custom_signal", "TestParam")
func _ready() -> void:
 say_hello()
 var result_add = add_numbers(5)
 print("Add result:", result_add)
 print("Process value for -5:", process_value(-5))
 print("Sum of array [10, 20, 30]:", sum_array([10, 20, 30]))
 print("Description for 2:", describe_number(2))
 print("Long description:\n", long_description())
 test_inner_class()
 trigger_signal()

View File

@@ -0,0 +1,107 @@
-- some code in Idris
module XX.X'''
import Data.Nat
data X = A | B
namespace X
 ||| Documentation
 record Y where
 [noHints]
 constructor MkY'
 field1 : Nat
 {auto x : Nat}
namespace X' {
 parameters (x : A (Maybe b))
 x : Nat
}
u : ()
u = ()
k, w, u : Char
k = '\NUL'
w = 'w'
x = [1, 0, 3, "sdf\{d}", 0xFF, 0o77, 0b10_1, 100_100]
f : Int -> Int
f = if x > 0 then x else 0 () SS `elem` S $ do
 x <- a [1, 2, 3]
 let ukuk = akak
 rewrite $ Wow Wow Wow Wow.Wow b W (W)
 pure $ f A B c D (EE) E
(&&&) : Nat -> Nat -> Nat
z &&& y = d + ?foo
(&&&) x y = ?asfda
public export covering
(.fun) : X a Y b => Nat -> Nat
Z .fun = haha.fun haha .N
(.fun) Z = ahah $ \case
 x@(x, y) => Prelude.Types.ahahah
(.N) : Nat -> Nat
Z .N = Z
(.N) (S n) = (.N) n
xx : Name
xx = `{Full.Name}
infixr 0 ^^^, &&&
xxx : ?
xxx = case x of
 Z => lalalaCamelCase
 z => alalalCamelCase
ff : Nat -> TTImp
ff 0 = let x = 0 in val
ff _ = `(let x = 0 in ~val ^~^ ~(abc))
ff _ = f `(let x = 0 in ~val ^~^ ~(abc)) x
%language ElabReflection
%runElab X.sf ads
%macro %inline
fff : List Decl
fff = `[
 f : Nat -> Nat
 f Z = haha %runElab %search @{%World}
]
private infixr 4 ^--^
(^--^) : Nat -> Nat -> Nat
(^--^) Z Z = Z
x ^--^ y = x + y
x : (y : Vect n (Maybe (Maybe (&&&) Nat))) ->
 {x : Nat} -> {auto _ : Monoid a} ->
 {default 4 xx : Nat} ->
 {default (f x Y) xx' : Nat} ->
 String
x Z S = ?foo
x y _ = "a b \{show $ let x = 0 in y} y >>= z"
multiline : String
multiline = """
 A multiline string\NUL
 """
f' : Nat -> Nat
f' = x' 4
x : Char
x = '\BEL'
x = '\\'
x = '\''
x = '\o755'
x = 'a'
xx : Int
xx = 0o7_5_5

View File

@@ -0,0 +1,3 @@
{"some":"thing"}
{"foo":17,"bar":false,"quux":true}
{"may":{"include":"nested","objects":["and","arrays"]}}

View File

@@ -1,3 +1,3 @@
2021-03-06 23:22:21.392 https://[2001:db8:4006:812::200e]:8080/path/the%20page.html
2021-03-06 23:22:21 https://example.com:8080/path/the%20page(with_parens).html
2022-03-16T17:41:02.519 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Error, message: "rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `\"cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/zeta/dev/raytracer/Cargo.toml\" \"--filter-platform\" \"wasm32-unknown-unknown\"`: `cargo metadata` exited with an error: Updating crates.io index\nerror: failed to select a version for `parking_lot`.\n ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`\nversions that meet the requirements `^0.12.0` are: 0.12.0\n\nthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.\n\n\nfailed to select a version for `parking_lot` which could resolve this conflict\n" }
2022-03-16T17:41:02.519 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Error, message: "rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `\"cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/zeta/dev/raytracer/Cargo.toml\" \"--filter-platform\" \"wasm32-unknown-unknown\"`: `cargo metadata` exited with an error: Updating crates.io index\nerror: failed to select a version for `parking_lot`.\n ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`\nversions that meet the requirements `^0.12.0` are: 0.12.0\n\nthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.\n\n\nfailed to select a version for `parking_lot` which could resolve this conflict\n" }

View File

@@ -0,0 +1,27 @@
package main
import "core:fmt"
import "core:math"
Vector :: struct {
 components: []f64,
}
euclidean_distance :: proc(v1: Vector, v2: Vector) -> f64 {
 if len(v1.components) != len(v2.components) {
 panic("Vectors must be same dimension")
 }
 sum: f64 = 0.0;
 for i, comp in v1.components {
 diff := comp - v2.components[i];
 sum += diff * diff;
 }
 return math.sqrt(sum);
}
main :: proc() {
 v1: Vector = Vector{components = []f64{1.0, 2.0, 3.0}};
 v2: Vector = Vector{components = []f64{4.0, 6.0, 8.0}};
 dist: f64 = euclidean_distance(v1, v2);
 fmt.println("Distance:", dist);
}

View File

@@ -1,16 +1,17 @@
Apr 4 00:00:01 hostname-here systemd[1]: logrotate.service: Succeeded.
Apr 4 00:00:01 hostname-here systemd[1]: Finished Rotate log files.
Apr 4 00:00:01 hostname-here colord[920]: failed to get session [pid 137485]: No data available
Apr 4 00:00:21 hostname-here kernel: [55604.908232] audit: type=1400 audit(1617483621.094:28): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=59311 comm="cups-browsed" capability=23 capname="sys_nice"
Apr 4 00:01:38 hostname-here systemd-resolved[721]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 4 00:04:46 hostname-here ntpd[952]: Soliciting pool server 255.76.59.37
Apr 4 00:05:21 hostname-here ntpd[952]: ::1 local addr 0:0:0:0:0:0:0:1 -> <null>
Apr 4 00:06:29 hostname-here ntpd[952]: receive: Unexpected origin timestamp 0xe414a8d1.82e825f5 does not match aorg 0xe414a8d5.82c50d8c from server@127.0.0.1 xmt 0xe414a8d1.e671d7c4
Apr 4 09:30:01 hostname-here CRON[89278]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Apr 4 16:32:07 hostname-here NetworkManager[740]: <info> [1617629527.1101] manager: NetworkManager state is now CONNECTED_GLOBAL
Apr 4 22:00:45 hostname-here dbus-daemon[1094]: [session uid=1000 pid=1094] Successfully activated service 'io.github.celluloid_player.Celluloid'
Aug 11 13:29:06 hostname-here insomnia_insomnia.desktop[142666]: 13:29:06.316 [updater] Updater not running platform=linux dev=false
Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epoll add event: fd:6 op:1 ev:00002001
Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001
Aug 11 21:40:31 hostname-here scop hello
Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories.
Apr 4 00:00:01 hostname-here systemd[1]: logrotate.service: Succeeded.
Apr 4 00:00:01 hostname-here systemd[1]: Finished Rotate log files.
Apr 4 00:00:01 hostname-here colord[920]: failed to get session [pid 137485]: No data available
Apr 4 00:00:21 hostname-here kernel: [55604.908232] audit: type=1400 audit(1617483621.094:28): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=59311 comm="cups-browsed" capability=23 capname="sys_nice"
Apr 4 00:01:38 hostname-here systemd-resolved[721]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr 4 00:04:46 hostname-here ntpd[952]: Soliciting pool server 255.76.59.37
Apr 4 00:05:21 hostname-here ntpd[952]: ::1 local addr 0:0:0:0:0:0:0:1 -> <null>
Apr 4 00:06:29 hostname-here ntpd[952]: receive: Unexpected origin timestamp 0xe414a8d1.82e825f5 does not match aorg 0xe414a8d5.82c50d8c from server@127.0.0.1 xmt 0xe414a8d1.e671d7c4
Apr 4 09:30:01 hostname-here CRON[89278]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Apr 4 16:32:07 hostname-here NetworkManager[740]: <info> [1617629527.1101] manager: NetworkManager state is now CONNECTED_GLOBAL
Apr 4 22:00:45 hostname-here dbus-daemon[1094]: [session uid=1000 pid=1094] Successfully activated service 'io.github.celluloid_player.Celluloid'
Aug 11 13:29:06 hostname-here insomnia_insomnia.desktop[142666]: 13:29:06.316 [updater] Updater not running platform=linux dev=false
Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epoll add event: fd:6 op:1 ev:00002001
Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001
Aug 11 21:40:31 hostname-here scop hello
Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories.
2025-02-08 20:52:11.039 - setfont: ERROR kdfontop.c:183 put_font_kdfontop: Unable to load such font with such kernel version

View File

@@ -0,0 +1,5 @@
<Project>
 <PropertyGroup>
 <OutDir>C:\output\$(MSBuildProjectName)</OutDir>
 </PropertyGroup>
</Project>

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
 <PropertyGroup>
 <OutputType>Exe</OutputType>
 <TargetFramework>net9.0</TargetFramework>
 <RootNamespace>SomeNamespace</RootNamespace>
 <ImplicitUsings>enable</ImplicitUsings>
 <Nullable>enable</Nullable>
 </PropertyGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <Target Name="TestTarget" AfterTargets="Build">
 <Message Importance="High" Text="-------------MHM----------------" />
 </Target>
</Project>

View File

@@ -0,0 +1,15 @@
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://deb.debian.org/debian bookworm main non-free-firmware
#deb-src https://deb.debian.org/debian bookworm main non-free-firmware
## Major bug fix updates produced after the final release of the
## distribution.
# deb-src http://lt.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb https://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src https://security.debian.org/debian-security bookworm-security main non-free-firmware
deb https://deb.debian.org/debian bookworm-updates main non-free-firmware
deb-src https://deb.debian.org/debian bookworm-updates main non-free-firmware

View File

@@ -0,0 +1,3 @@
foo,bar,baz,this|that,test,colors,cycle
1.2,1.7,2.5,blah;cool,test,colors,cycle
1 foo bar baz this|that test colors cycle
2 1.2 1.7 2.5 blah;cool test colors cycle

View File

@@ -0,0 +1,3 @@
foo|bar|baz
1,2|1,7|2,7
1,5|8,5|-5,5
1 foo bar baz
2 1,2 1,7 2,7
3 1,5 8,5 -5,5

View File

@@ -0,0 +1,3 @@
foo;bar;baz
1,2;1,7;2,7
1,5;8,5;-5,5
1 foo bar baz
2 1,2 1,7 2,7
3 1,5 8,5 -5,5

View File

@@ -0,0 +1,3 @@
foo bar baz|;, test hello world tsv
1,2 1,7 2,7 a b c "hello again" tsv
";|," ;|, baz test "hello world" tsv
1 foo bar baz|;, test hello world tsv
2 1,2 1,7 2,7 a b c hello again tsv
3 ;|, ;|, baz test hello world tsv

View File

@@ -0,0 +1,71 @@
extends Node
signal custom_signal(param)
const PI = 3.14159
var untyped_var = "Hello, World!"
var typed_int: int = 42
var typed_float: float = 3.14
var typed_string: String = "GDScript Test"
var typed_array: Array = [1, 2, 3, 4]
var typed_dict: Dictionary = {"key": "value", "number": 100}
onready var label = $Label
func say_hello() -> void:
print("Hello from GDScript!")
func add_numbers(a: int, b: int = 10) -> int:
return a + b
func process_value(value: int) -> String:
if value < 0:
return "Negative"
elif value == 0:
return "Zero"
else:
return "Positive"
func sum_array(arr: Array) -> int:
var total: int = 0
for num in arr:
total += num
return total
func describe_number(num: int) -> String:
match num:
0:
return "Zero"
1, 2, 3:
return "Small number"
_:
return "Large number"
func long_description() -> String:
return """This is a test file for GDScript.
It covers variables, functions, control structures, loops, signals, inner classes,
multiline strings, arrays, and dictionaries."""
class InnerExample:
var inner_value: int = 99
func show_value() -> void:
print("Inner value is:", inner_value)
func test_inner_class() -> void:
var inner = InnerExample.new()
inner.show_value()
func trigger_signal() -> void:
emit_signal("custom_signal", "TestParam")
func _ready() -> void:
say_hello()
var result_add = add_numbers(5)
print("Add result:", result_add)
print("Process value for -5:", process_value(-5))
print("Sum of array [10, 20, 30]:", sum_array([10, 20, 30]))
print("Description for 2:", describe_number(2))
print("Long description:\n", long_description())
test_inner_class()
trigger_signal()

View File

@@ -0,0 +1,7 @@
The `test.idr` file has been added from https://github.com/buzden/sublime-syntax-idris2 under the following license:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0

View File

@@ -0,0 +1,107 @@
-- some code in Idris
module XX.X'''
import Data.Nat
data X = A | B
namespace X
||| Documentation
record Y where
[noHints]
constructor MkY'
field1 : Nat
{auto x : Nat}
namespace X' {
parameters (x : A (Maybe b))
x : Nat
}
u : ()
u = ()
k, w, u : Char
k = '\NUL'
w = 'w'
x = [1, 0, 3, "sdf\{d}", 0xFF, 0o77, 0b10_1, 100_100]
f : Int -> Int
f = if x > 0 then x else 0 () SS `elem` S $ do
x <- a [1, 2, 3]
let ukuk = akak
rewrite $ Wow Wow Wow Wow.Wow b W (W)
pure $ f A B c D (EE) E
(&&&) : Nat -> Nat -> Nat
z &&& y = d + ?foo
(&&&) x y = ?asfda
public export covering
(.fun) : X a Y b => Nat -> Nat
Z .fun = haha.fun haha .N
(.fun) Z = ahah $ \case
x@(x, y) => Prelude.Types.ahahah
(.N) : Nat -> Nat
Z .N = Z
(.N) (S n) = (.N) n
xx : Name
xx = `{Full.Name}
infixr 0 ^^^, &&&
xxx : ?
xxx = case x of
Z => lalalaCamelCase
z => alalalCamelCase
ff : Nat -> TTImp
ff 0 = let x = 0 in val
ff _ = `(let x = 0 in ~val ^~^ ~(abc))
ff _ = f `(let x = 0 in ~val ^~^ ~(abc)) x
%language ElabReflection
%runElab X.sf ads
%macro %inline
fff : List Decl
fff = `[
f : Nat -> Nat
f Z = haha %runElab %search @{%World}
]
private infixr 4 ^--^
(^--^) : Nat -> Nat -> Nat
(^--^) Z Z = Z
x ^--^ y = x + y
x : (y : Vect n (Maybe (Maybe (&&&) Nat))) ->
{x : Nat} -> {auto _ : Monoid a} ->
{default 4 xx : Nat} ->
{default (f x Y) xx' : Nat} ->
String
x Z S = ?foo
x y _ = "a b \{show $ let x = 0 in y} y >>= z"
multiline : String
multiline = """
A multiline string\NUL
"""
f' : Nat -> Nat
f' = x' 4
x : Char
x = '\BEL'
x = '\\'
x = '\''
x = '\o755'
x = 'a'
xx : Int
xx = 0o7_5_5

View File

@@ -0,0 +1,3 @@
{"some":"thing"}
{"foo":17,"bar":false,"quux":true}
{"may":{"include":"nested","objects":["and","arrays"]}}

View File

@@ -0,0 +1,27 @@
package main
import "core:fmt"
import "core:math"
Vector :: struct {
components: []f64,
}
euclidean_distance :: proc(v1: Vector, v2: Vector) -> f64 {
if len(v1.components) != len(v2.components) {
panic("Vectors must be same dimension")
}
sum: f64 = 0.0;
for i, comp in v1.components {
diff := comp - v2.components[i];
sum += diff * diff;
}
return math.sqrt(sum);
}
main :: proc() {
v1: Vector = Vector{components = []f64{1.0, 2.0, 3.0}};
v2: Vector = Vector{components = []f64{4.0, 6.0, 8.0}};
dist: f64 = euclidean_distance(v1, v2);
fmt.println("Distance:", dist);
}

View File

@@ -14,3 +14,4 @@ Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epol
Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001
Aug 11 21:40:31 hostname-here scop hello
Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories.
2025-02-08 20:52:11.039 - setfont: ERROR kdfontop.c:183 put_font_kdfontop: Unable to load such font with such kernel version

View File

@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<OutDir>C:\output\$(MSBuildProjectName)</OutDir>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>SomeNamespace</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="TestTarget" AfterTargets="Build">
<Message Importance="High" Text="-------------MHM----------------" />
</Target>
</Project>

View File

@@ -0,0 +1,15 @@
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://deb.debian.org/debian bookworm main non-free-firmware
#deb-src https://deb.debian.org/debian bookworm main non-free-firmware
## Major bug fix updates produced after the final release of the
## distribution.
# deb-src http://lt.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb https://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src https://security.debian.org/debian-security bookworm-security main non-free-firmware
deb https://deb.debian.org/debian bookworm-updates main non-free-firmware
deb-src https://deb.debian.org/debian bookworm-updates main non-free-firmware