Skip to content

msgfmt.py: Test validity of generated file #131853

Closed
@StanFromIreland

Description

@StanFromIreland

Feature or enhancement

Proposal:

Test the header of the binary .mo file is generated correctly and is as expected for example the start of a msgfmt.py generated file:

de12 0495 0000 0000 0900 0000 1c00 0000
6400 0000 0000 0000 0000 0000 0000 0000

de12 0495 - magic number
0000 0000 - version
0900 0000 - # of entries
1c00 0000 - start of key index
6400 0000 - size of value table
0000 0000 - size of hash table
0000 0000 - offset of hash table

We currently do not test the structure of the .mo though it is partially covered as I presume the translation tests may fail but that depends on gettext.

Testing the last four will result in errors with a msgfmt.c generated general.mo as msgfmt.c generates a hash table (this will change soon I hope as we will too #131725 :-) so I think we should just test the first 3 for now and test the rest later.

I will send a pr

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions