Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

The rustico procedural macro lacked test coverage for its Spanish-to-English keyword translation functionality.

Changes

Added 44 integration tests across 7 test files covering:

  • Core syntax - functions (función), variables (sea, mutable), control flow (si/sino, machea, para, mientras, bucle)
  • Type system - signed/unsigned integers (e32/n32), booleans (bul, verdad/falso), strings (Cadena)
  • Option/Result - Opcion<T>/Resultado<T, E> with Alguno/Ninguno, Bien/Error, and methods (pelar, confia)
  • Structs/Enums - estructura, enumerado, implementa, visibility (púb)
  • Traits - rasgo, trait implementations, Self references (Yo/Mismo)
  • Stdlib - Diccionario (HashMap), Conjunto (HashSet), Caja (Box)
  • Keyword alternatives - accented variants (función/funcion) and synonyms (deja/sea, retorna/devuelve)

Updated CI workflow to run tests on every commit:

  • Added test step to .github/workflows/ci.yaml to execute cargo test --all
  • Fixed code formatting with cargo fmt --all to pass existing CI checks

Example

#[test]
fn test_basic_function() {
    rustico::rustico! {
        función prueba() -> e32 {
            sea x = 5;
            si x > 3 {
                retorna x * 2;
            } sino {
                retorna 0;
            }
        }
    }
    
    assert_eq!(prueba(), 10);
}

Tests verify the macro correctly translates Spanish keywords to their English equivalents and the resulting code compiles and executes as expected. CI now automatically runs all tests on every commit to ensure code quality.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add tests</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@UltiRequiem
Copy link
Owner

If this does works this gonna be a game changer lmfao

Copilot AI changed the title [WIP] Add tests for existing functionality Add comprehensive test suite for Spanish keyword translation Oct 31, 2025
Copilot AI requested a review from UltiRequiem October 31, 2025 15:12
Copy link
Owner

@UltiRequiem UltiRequiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@UltiRequiem
Copy link
Owner

@copilot Please update the CI to run this tests every commit also run cargo fmt --all -- --check so it passes the current CI

Copy link
Contributor Author

Copilot AI commented Oct 31, 2025

@copilot Please update the CI to run this tests every commit also run cargo fmt --all -- --check so it passes the current CI

Updated the CI workflow to run tests on every commit and fixed code formatting to pass cargo fmt --all -- --check. Changes in commit d3c5efa.

Copy link
Owner

@UltiRequiem UltiRequiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@UltiRequiem UltiRequiem marked this pull request as ready for review October 31, 2025 15:49
@UltiRequiem UltiRequiem merged commit a9a57ef into principal Oct 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests

2 participants