style: 减少自动格式化换行

This commit is contained in:
爱特每羊队
2026-06-09 00:53:46 +08:00
parent 4713b46d5c
commit 5d1d25074e
86 changed files with 672 additions and 2645 deletions
+1 -4
View File
@@ -7,10 +7,7 @@ pub use oxc_allocator::Allocator;
pub use oxc_ast::ast::*;
pub use oxc_span::Span;
pub fn parse<'a>(
allocator: &'a Allocator,
source: &'a str,
) -> Result<Program<'a>, Vec<OxideError>> {
pub fn parse<'a>(allocator: &'a Allocator, source: &'a str) -> Result<Program<'a>, Vec<OxideError>> {
use oxc_parser::Parser;
use oxc_span::SourceType;
+3 -12
View File
@@ -13,10 +13,7 @@ fn parse_empty_string() {
let result = oxide_parser::parse(&allocator, "");
assert!(result.is_ok(), "empty string should parse");
let program = result.unwrap();
assert!(
program.body.is_empty(),
"empty program should have empty body"
);
assert!(program.body.is_empty(), "empty program should have empty body");
}
#[test]
@@ -25,10 +22,7 @@ fn parse_function_declaration() {
let result = oxide_parser::parse(&allocator, "function foo() { return 42; }");
assert!(result.is_ok(), "function declaration should parse");
let program = result.unwrap();
assert!(
!program.body.is_empty(),
"program with function should not be empty"
);
assert!(!program.body.is_empty(), "program with function should not be empty");
}
#[test]
@@ -37,10 +31,7 @@ fn parse_syntax_error() {
let result = oxide_parser::parse(&allocator, "function(");
assert!(result.is_err(), "syntax error should return Err");
let errors = result.unwrap_err();
assert!(
!errors.is_empty(),
"syntax error should produce at least one error"
);
assert!(!errors.is_empty(), "syntax error should produce at least one error");
}
#[test]