aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-10-02 06:33:41 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-10-02 06:33:41 +0200
commitd74582678e03a5a47d1dbe8a319739de36a42162 (patch)
tree19e009ac7a6ee8fe410ac386a51ec86a024a2904 /tests
parentb4b95a173230ce2b836be0cff064bdb6a67d0076 (diff)
downloadele-d74582678e03a5a47d1dbe8a319739de36a42162.tar.gz
ele-d74582678e03a5a47d1dbe8a319739de36a42162.zip
Rename crate and CLI to ele
Diffstat (limited to 'tests')
-rw-r--r--tests/cli_tests.rs22
-rw-r--r--tests/compiled_tests.rs10
-rw-r--r--tests/eval_tests.rs2
-rw-r--r--tests/has_path_tests.rs2
-rw-r--r--tests/json_number_tests.rs2
-rw-r--r--tests/limit_tests.rs4
-rw-r--r--tests/parse_tests.rs2
7 files changed, 22 insertions, 22 deletions
diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs
index ca817ed..6485d4c 100644
--- a/tests/cli_tests.rs
+++ b/tests/cli_tests.rs
@@ -6,7 +6,7 @@ fn run(expr: &str, input: &str, args: &[&str]) -> Output {
}
fn run_bytes(expr: &str, input: &[u8], args: &[&str]) -> Output {
- let mut child = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let mut child = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(args)
.arg(expr)
.stdin(Stdio::piped())
@@ -139,7 +139,7 @@ fn empty_filter_and_print_mode() {
let output = run("", input, &[]);
assert!(output.status.success());
assert_eq!(output.stdout, input.as_bytes());
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["--print", ""])
.stdin(Stdio::null())
.output()
@@ -148,7 +148,7 @@ fn empty_filter_and_print_mode() {
assert!(output.stdout.is_empty());
let path = format!("{}/README.md", env!("CARGO_MANIFEST_DIR"));
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["", &path])
.stdin(Stdio::null())
.output()
@@ -160,7 +160,7 @@ fn empty_filter_and_print_mode() {
#[test]
fn information_flags_succeed_and_unknown_long_options_fail() {
for flag in ["--help", "-h", "--version", "-V"] {
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(flag)
.stdin(Stdio::null())
.output()
@@ -173,11 +173,11 @@ fn information_flags_succeed_and_unknown_long_options_fail() {
assert!(text.contains("--max-record-bytes"));
assert!(text.contains("--version"));
} else {
- assert_eq!(text, format!("aif {}\n", env!("CARGO_PKG_VERSION")));
+ assert_eq!(text, format!("ele {}\n", env!("CARGO_PKG_VERSION")));
}
}
for flag in ["--verison", "--unknown", "--print=invalid"] {
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(flag)
.stdin(Stdio::null())
.output()
@@ -271,7 +271,7 @@ fn filtering_multiple_files_preserves_successful_output() {
let second = dir.join("second.jsonl");
std::fs::write(&first, b"\"match first\"\n").unwrap();
std::fs::write(&second, b"invalid\n\"match second\"\n").unwrap();
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("match")
.arg(&first)
.arg(&second)
@@ -296,7 +296,7 @@ fn multiple_files_keep_record_boundaries_without_forcing_a_final_newline() {
for ending in ["", "\n", "\r\n"] {
std::fs::write(&first, format!("\"match first\"{ending}")).unwrap();
std::fs::write(&last, b"\"match last\"").unwrap();
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("match")
.args([&first, &middle, &last])
.output()
@@ -315,7 +315,7 @@ fn multiple_files_keep_record_boundaries_without_forcing_a_final_newline() {
}
std::fs::write(&first, b"raw").unwrap();
std::fs::write(&last, b"bytes").unwrap();
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("")
.args([&first, &last])
.output()
@@ -332,7 +332,7 @@ fn output_flush_errors_are_reported() {
use std::os::unix::net::UnixStream;
let (writer, reader) = UnixStream::pair().unwrap();
drop(reader);
- let mut child = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let mut child = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("foobar")
.stdin(Stdio::piped())
.stdout(Stdio::from(OwnedFd::from(writer)))
@@ -349,7 +349,7 @@ fn output_flush_errors_are_reported() {
for flag in ["--help", "--version"] {
let (writer, reader) = UnixStream::pair().unwrap();
drop(reader);
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(flag)
.stdin(Stdio::null())
.stdout(Stdio::from(OwnedFd::from(writer)))
diff --git a/tests/compiled_tests.rs b/tests/compiled_tests.rs
index 56059c5..c8c9be7 100644
--- a/tests/compiled_tests.rs
+++ b/tests/compiled_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Expr, Filterable, Value, parse};
+use ele::{Expr, Filterable, Value, parse};
use serde_json::json;
use std::process::{Command, Stdio};
@@ -21,7 +21,7 @@ fn unsupported_functions_reject_the_entire_filter() {
.contains("function calls are not supported")
);
assert!(!expr.evaluate(&record), "{input}");
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(input)
.stdin(Stdio::null())
.output()
@@ -32,7 +32,7 @@ fn unsupported_functions_reject_the_entire_filter() {
String::from_utf8_lossy(&output.stderr).contains("function calls are not supported")
);
}
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["--print", "fn(x)"])
.output()
.unwrap();
@@ -131,9 +131,9 @@ fn regex_resources_and_manual_trees_are_bounded() {
let mut expr = parse("value").unwrap().unwrap();
for _ in 0..150 {
expr = Expr::Unary {
- op: aif::UnaryOp::Not,
+ op: ele::UnaryOp::Not,
expr: Box::new(expr),
- pos: aif::Position { line: 1, col: 1 },
+ pos: ele::Position { line: 1, col: 1 },
};
}
assert!(expr.compile().unwrap_err().contains("expression limit"));
diff --git a/tests/eval_tests.rs b/tests/eval_tests.rs
index ae3edec..7fb901d 100644
--- a/tests/eval_tests.rs
+++ b/tests/eval_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
struct Record<'a> {
value: Value<'a>,
diff --git a/tests/has_path_tests.rs b/tests/has_path_tests.rs
index 281a8e6..5d74768 100644
--- a/tests/has_path_tests.rs
+++ b/tests/has_path_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
use serde_json::json;
fn matches(record: &impl Filterable, text: &str) -> bool {
diff --git a/tests/json_number_tests.rs b/tests/json_number_tests.rs
index 0a0662d..e81080c 100644
--- a/tests/json_number_tests.rs
+++ b/tests/json_number_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
use serde_json::{Number, Value as Json};
#[test]
diff --git a/tests/limit_tests.rs b/tests/limit_tests.rs
index b3f6575..43f734e 100644
--- a/tests/limit_tests.rs
+++ b/tests/limit_tests.rs
@@ -1,4 +1,4 @@
-use aif::{parse, parser::MAX_FILTER_BYTES};
+use ele::{parse, parser::MAX_FILTER_BYTES};
use std::process::Command;
#[test]
@@ -16,7 +16,7 @@ fn excessive_filters_report_errors_without_crashing() {
"界".repeat(MAX_FILTER_BYTES / "界".len() + 1),
];
for filter in filters {
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["--print", &filter])
.output()
.unwrap();
diff --git a/tests/parse_tests.rs b/tests/parse_tests.rs
index 40a3879..b032c1e 100644
--- a/tests/parse_tests.rs
+++ b/tests/parse_tests.rs
@@ -1,4 +1,4 @@
-use aif::parse;
+use ele::parse;
use std::collections::HashSet;
use std::fs;
use std::path::Path;