use crate::oracle_tests;
use crate::tests_common::test_ir_format;
oracle_tests! {
test_ir_format;
test_simple_parameter_pattern => ["{ a, b }: x"],
test_selection_with_default_structure => ["config.services.nginx.enable or false"],
test_update_absorbable_rhs_structure => ["attrs // { inherit value; }"],
test_app_selection_inner_arg => ["f a.b c"],
test_app_two_consecutive_list_args => ["f [ 1 ] [ 2 ] x"],
test_app_two_trailing_list_args => ["f a b [ 1 ] [ 2 ]"],
test_app_absorb_last_paren_application => ["f (g { a = 1; })"],
test_inherit_many_identifiers_structure => ["let inherit foo bar baz qux; in foo"],
test_inherit_with_source_structure => ["let inherit (inputs) foo bar; in foo"],
test_selection_from_parenthesized_term_structure => ["({ inherit foo; }).foo or true"],
test_selection_from_record_term_structure => ["rec { nested = { }; }.nested or { }"],
test_comment_structure => ["/* block comment */ let a = 1; in a # line comment"],
test_empty_line_structure => ["{\n\n a = 1;\n}"],
test_multiline_string_structure => ["''\n line1\n line2\n''"],
test_string_interpolation_structure => ["\"prefix ${expr} suffix\""],
test_nested_groups_structure => ["[ { a = 1; } { b = 2; } ]"],
test_negation_structure => ["-42"],
test_boolean_not_structure => ["!true"],
test_parenthesized_complex_structure => ["(let x = 1; in x)"],
test_list_with_comments_structure => ["[\n # comment\n 1\n 2\n]"],
test_rec_set_structure => ["rec { a = 1; b = a; }"],
test_path_term_structure => ["./path/to/file"],
test_float_token => ["3.14"],
test_env_path_token => ["<nixpkgs>"],
test_member_check_full => ["attrs ? foo.bar"],
test_concat_with_absorbable_rhs => ["[ 1 ] ++ [ 2 3 ]"],
test_lambda_chain_structure => ["a: b: c: d: body"],
test_context_parameter => ["args@{ a, b }: a"],
test_parameter_with_defaults => ["{ a ? 1, b ? 2 }: a + b"],
test_parameter_with_ellipsis => ["{ ... }: x"],
test_empty_parameter_multiline => ["{\n\n}: x"],
test_doc_comment_structure => ["/** doc comment */\nx"],
test_language_annotation => ["/* nix */ \"code\""],
test_string_interpolation_with_absorbable => ["\"prefix ${{ x = 1; }} suffix\""],
test_string_with_leading_whitespace_interpolation => ["\" ${expr}\""],
test_operation_with_application_rhs => ["x + f a b"],
test_arithmetic_operators => ["a - b * c / d"],
test_language_annotation_with_string_item => ["{\n /* python */ a = \"code\";\n}"],
test_paren_simple_term => ["(a)"],
test_paren_trailing_comment_on_open => ["( # c\n a )"],
test_paren_absorb_rhs => ["{ x = (a b); }"],
test_app_last_arg_with_pre_comment => ["(map toString\n # comment\n (builtins.filter f version))"],
test_paren_inner_arg_unexpanded => ["f (a b) c"],
test_param_trailing_comment_after_comma => ["{ a ? false, # c\n b }: a"],
test_param_trailing_comment_last_attr => ["{ a, # c\n b ? 1, # d\n}: a"],
test_param_trailing_comment_before_comma => ["{ a # c\n, b }: a"],
test_param_trailing_comment_on_default_before_comma => ["{ a ? 1 # c\n, b }: a"],
test_param_comma_pretrivia_moves_to_next => [
"{ a\n# comment\n, b }: a",
"{ a\n# comment\n, ... }: a",
],
}