Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature] Make `check_equal` a generic procedure

Aperta
#1,030 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Ambito
testing

Direzione di ricerca

The issue proposes a generic check_equal procedure but names no source files or tests. Start by locating the existing check_equal declarations, implementations, and tests, then check which VHDL generic procedure features the project supports. Done means custom types can use the generic check while the existing equality checks remain covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Enhancement

Hey there, I thought to make the testing even more powerful. I'd suggest to make check_equal a generic procedure in order to make it easier to define a new one for any other type.

Suggested code:

package example_pkg is
    procedure check_equal_generic
        generic (
            type type_t;
            function to_string(data: type_t) return string
        )
        parameter (
            got: in type_t;
            expected: in type_t;
            msg: in string := check_result_tag;
            level: in log_level_t := null_log_level;
            path_offset: in natural := 1;
            line_num: in natural := 0;
            file_name: in string := ""
        );

    type test_t is (st_1, st_2);
    procedure check_equal is new check_equal_generic generic map (type_t => test_t, to_string => to_string); -- to_string is implicitly defined
end package;

package body example_pkg is
    -- Overloaded generic check_equal procedures for custom checks
    procedure check_equal_generic
        generic (
            type type_t;
            function to_string(data: type_t) return string
        )
        parameter (
            got: in type_t;
            expected: in type_t;
            msg: in string := check_result_tag;
            level: in log_level_t := null_log_level;
            path_offset: in natural := 1;
            line_num: in natural := 0;
            file_name: in string := ""
        )
    is
        constant checker: checker_t := default_checker;
    begin
        -- pragma translate_off
        if got = expected then
            if is_pass_visible(checker) then
                passing_check(
                    checker,
                    p_std_msg(
                        "Equality check passed", msg,
                        "Got " & to_string(got) & "."
                    ),
                    path_offset + 1, line_num, file_name
                );
            else
                passing_check(checker);
            end if;
        else
            failing_check(
                checker,
                p_std_msg(
                    "Equality check failed", msg,
                    "Got " & to_string(got) & ". " &
                    "Expected " & to_string(expected) & "."
                ),
                level, path_offset + 1, line_num, file_name
            );
        end if;
    end;
end package body;
Lingua principale
VHDL
Stelle
850
Fork
305
Merge medio
2g 10h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di VUnit/vunit

Tutte le issue di VUnit/vunit

Issue simili

Altre issue su Testing & QA

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.