#![allow(dead_code)]
#[test]
fn test_codes_module_imports() {
use perl_diagnostics::codes::DiagnosticCategory;
use perl_diagnostics::codes::DiagnosticCode;
use perl_diagnostics::codes::DiagnosticSeverity;
use perl_diagnostics::codes::DiagnosticTag;
let _ = (
DiagnosticCode::ParseError,
DiagnosticSeverity::Error,
DiagnosticTag::Unnecessary,
DiagnosticCategory::Parser,
);
}
#[test]
fn test_types_module_imports() {
use perl_diagnostics::types::Diagnostic;
use perl_diagnostics::types::RelatedInformation;
let _ = (Diagnostic::default(), RelatedInformation::default());
}
#[test]
fn test_types_module_reexports_unified_types() {
use perl_diagnostics::types::DiagnosticSeverity;
use perl_diagnostics::types::DiagnosticTag;
let _ = (DiagnosticSeverity::Error, DiagnosticTag::Unnecessary);
}
#[test]
fn test_catalog_module_imports() {
use perl_diagnostics::catalog::DiagnosticMeta;
use perl_diagnostics::catalog::diagnostic_meta;
use perl_diagnostics::catalog::parse_error;
let _ = (DiagnosticMeta::default(), diagnostic_meta, parse_error);
}
#[test]
fn test_api_root_reexports_codes_types() {
use perl_diagnostics::DiagnosticCategory;
use perl_diagnostics::DiagnosticCode;
use perl_diagnostics::DiagnosticSeverity;
let _ = (DiagnosticCode::ParseError, DiagnosticSeverity::Error, DiagnosticCategory::Parser);
}
#[test]
fn test_api_root_reexports_catalog() {
use perl_diagnostics::diagnostic_meta;
use perl_diagnostics::parse_error;
let _ = (diagnostic_meta, parse_error);
}
#[test]
fn test_severity_type_unification_cross_path_assignment() {
use perl_diagnostics::codes::DiagnosticSeverity as CodesSeverity;
use perl_diagnostics::types::DiagnosticSeverity as TypesSeverity;
let from_codes: CodesSeverity = CodesSeverity::Error;
let _as_types: TypesSeverity = from_codes;
assert_eq!(from_codes as u8, 1); }
#[test]
fn test_tag_type_unification_cross_path_assignment() {
use perl_diagnostics::codes::DiagnosticTag as CodesTag;
use perl_diagnostics::types::DiagnosticTag as TypesTag;
let from_codes: CodesTag = CodesTag::Unnecessary;
let _as_types: TypesTag = from_codes;
}
#[test]
fn test_severity_type_identity_same_underlying_type() {
use perl_diagnostics::codes::DiagnosticSeverity as CodesSeverity;
use perl_diagnostics::types::DiagnosticSeverity as TypesSeverity;
let codes_type_id = std::any::TypeId::of::<CodesSeverity>();
let types_type_id = std::any::TypeId::of::<TypesSeverity>();
assert_eq!(
codes_type_id, types_type_id,
"DiagnosticSeverity must be a single unified type, not two separate enums"
);
}
#[test]
fn test_tag_type_identity_same_underlying_type() {
use perl_diagnostics::codes::DiagnosticTag as CodesTag;
use perl_diagnostics::types::DiagnosticTag as TypesTag;
let codes_type_id = std::any::TypeId::of::<CodesTag>();
let types_type_id = std::any::TypeId::of::<TypesTag>();
assert_eq!(
codes_type_id, types_type_id,
"DiagnosticTag must be a single unified type, not two separate enums"
);
}
#[test]
fn test_diagnostic_struct_uses_unified_severity() {
use perl_diagnostics::types::Diagnostic;
use perl_diagnostics::types::DiagnosticSeverity;
let diag = Diagnostic { severity: DiagnosticSeverity::Error, ..Default::default() };
let _severity = diag.severity;
}
#[test]
fn test_api_includes_diagnostic_category_reexport() {
use perl_diagnostics::DiagnosticCategory;
let _ = DiagnosticCategory::Parser;
}
#[test]
fn test_api_reexports_explicit_not_wildcards() {
use perl_diagnostics::{
Diagnostic, DiagnosticCategory, DiagnosticCode, DiagnosticSeverity, DiagnosticTag,
RelatedInformation, diagnostic_meta, parse_error, syntax_error,
};
let _ = (
DiagnosticCode::ParseError,
DiagnosticSeverity::Error,
DiagnosticTag::Unnecessary,
DiagnosticCategory::Parser,
Diagnostic::default(),
RelatedInformation::default(),
diagnostic_meta,
parse_error,
syntax_error,
);
}
#[test]
fn test_consumer_perl_lsp_code_actions_path() {
use perl_diagnostics::codes::DiagnosticCode;
use perl_diagnostics::types::Diagnostic;
let _ = (DiagnosticCode::ParseError, Diagnostic::default());
}
#[test]
fn test_consumer_perl_lsp_diagnostics_path() {
use perl_diagnostics::codes::DiagnosticSeverity;
use perl_diagnostics::types::Diagnostic;
use perl_diagnostics::types::DiagnosticSeverity as TypesSeverity;
let from_codes = DiagnosticSeverity::Warning;
let _as_types: TypesSeverity = from_codes;
let _ = Diagnostic::default();
}
#[test]
fn test_consumer_perl_lsp_server_path() {
use perl_diagnostics::catalog::diagnostic_meta;
use perl_diagnostics::codes::DiagnosticCode;
let _ = (DiagnosticCode::ParseError, diagnostic_meta);
}
#[test]
fn test_severity_lsp_values() {
use perl_diagnostics::codes::DiagnosticSeverity;
assert_eq!(DiagnosticSeverity::Error as u8, 1);
assert_eq!(DiagnosticSeverity::Warning as u8, 2);
assert_eq!(DiagnosticSeverity::Information as u8, 3);
assert_eq!(DiagnosticSeverity::Hint as u8, 4);
}
#[test]
fn test_tag_lsp_values() {
use perl_diagnostics::codes::DiagnosticTag;
assert_eq!(DiagnosticTag::Unnecessary as u8, 1);
assert_eq!(DiagnosticTag::Deprecated as u8, 2);
}
#[test]
#[ignore] fn test_workspace_member_count_should_be_121() {
}
#[test]
#[ignore] fn test_publish_allowlist_count_should_be_118() {
}
#[test]
fn test_no_circular_dependency_codes_types() {
use perl_diagnostics::codes::DiagnosticCode;
use perl_diagnostics::types::Diagnostic;
let diag = Diagnostic { code: DiagnosticCode::ParseError, ..Default::default() };
let _ = diag;
}
#[test]
fn test_diagnostic_struct_fields_accessible() {
use perl_diagnostics::types::{Diagnostic, DiagnosticSeverity};
let diag = Diagnostic {
code: perl_diagnostics::codes::DiagnosticCode::ParseError,
severity: DiagnosticSeverity::Error,
range: Default::default(),
message: "test".to_string(),
related_information: None,
tags: None,
};
assert_eq!(diag.message, "test");
}
#[test]
#[ignore] fn test_perl_diagnostics_no_perl_lsp_dependencies() {
}
#[test]
fn test_catalog_function_reexports() {
use perl_diagnostics::{
bareword_filehandle, critic_severity_1, critic_severity_2, critic_severity_3,
critic_severity_4, critic_severity_5, duplicate_package, duplicate_sub, eval_error_flow,
from_message, implicit_return, missing_package_declaration, missing_return, missing_strict,
missing_warnings, parse_error, syntax_error, two_arg_open, undefined_var, unexpected_eof,
unused_var,
};
let _ = (
parse_error,
syntax_error,
unexpected_eof,
missing_strict,
missing_warnings,
unused_var,
undefined_var,
missing_package_declaration,
duplicate_package,
duplicate_sub,
missing_return,
bareword_filehandle,
two_arg_open,
implicit_return,
eval_error_flow,
critic_severity_5,
critic_severity_4,
critic_severity_3,
critic_severity_2,
critic_severity_1,
from_message,
);
}
#[test]
fn test_diagnostic_meta_reexport() {
use perl_diagnostics::DiagnosticMeta;
let _ = DiagnosticMeta::default();
}
#[test]
fn test_related_information_struct_accessible() {
use perl_diagnostics::types::RelatedInformation;
let info = RelatedInformation { message: "test".to_string(), location: Default::default() };
assert_eq!(info.message, "test");
}