[GH-ISSUE #1171] [Test]: Unit tests that cover other Enum NumberFormat #465

Closed
opened 2026-03-23 20:36:51 +00:00 by mirror · 2 comments
Owner

Originally created by @appflowy on GitHub (Sep 26, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1171

Originally assigned to: @ZZITE on GitHub.

Cover other enum types in NumberFormat. For the moment, only Number, USD, Yen, Yuan, and EUR get covered.

  for format in NumberFormat::iter() {
    type_option.format = format;
    match format {
        NumberFormat::Num => {
            assert_number(&type_option, "18443", "18443", &field_type, &field_rev);
        }
        NumberFormat::USD => {
            assert_number(&type_option, "18443", "$18,443", &field_type, &field_rev);
        }
        NumberFormat::Yen => {
            assert_number(&type_option, "18443", "¥18,443", &field_type, &field_rev);
        }
        NumberFormat::Yuan => {
            assert_number(&type_option, "18443", "CN¥18,443", &field_type, &field_rev);
        }
        NumberFormat::EUR => {
            assert_number(&type_option, "18443", "€18.443", &field_type, &field_rev);
        }
        _ => {}
    }
}

Check out the number_type_option_format_number_test and
number_type_option_format_str_test function for more information.

Originally created by @appflowy on GitHub (Sep 26, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1171 Originally assigned to: @ZZITE on GitHub. Cover other enum types in NumberFormat. For the moment, only `Number`, `USD`, `Yen`, `Yuan`, and `EUR` get covered. ```rust for format in NumberFormat::iter() { type_option.format = format; match format { NumberFormat::Num => { assert_number(&type_option, "18443", "18443", &field_type, &field_rev); } NumberFormat::USD => { assert_number(&type_option, "18443", "$18,443", &field_type, &field_rev); } NumberFormat::Yen => { assert_number(&type_option, "18443", "¥18,443", &field_type, &field_rev); } NumberFormat::Yuan => { assert_number(&type_option, "18443", "CN¥18,443", &field_type, &field_rev); } NumberFormat::EUR => { assert_number(&type_option, "18443", "€18.443", &field_type, &field_rev); } _ => {} } } ``` Check out the [number_type_option_format_number_test](https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/rust-lib/flowy-grid/src/services/field/type_options/number_type_option/number_tests.rs) and [number_type_option_format_str_test](https://github.com/AppFlowy-IO/AppFlowy/blob/main/frontend/rust-lib/flowy-grid/src/services/field/type_options/number_type_option/number_tests.rs) function for more information.
Author
Owner

@ZZITE commented on GitHub (Sep 27, 2022):

I see there is another issue #1170 that looks the same, Is there any difference?

I’m interested in this project and I'm just starting to learn rust, can i work it?

<!-- gh-comment-id:1258864153 --> @ZZITE commented on GitHub (Sep 27, 2022): I see there is another issue #1170 that looks the same, Is there any difference? I’m interested in this project and I'm just starting to learn rust, can i work it?
Author
Owner

@appflowy commented on GitHub (Sep 27, 2022):

I see there is another issue #1170 that looks the same, Is there any difference?

I’m interested in this project and I'm just starting to learn rust, can i work it?

#1170 is duplicated.

Sure, I assigned it to you. You can DM me in discord if you have any questions.

<!-- gh-comment-id:1258865598 --> @appflowy commented on GitHub (Sep 27, 2022): > I see there is another issue #1170 that looks the same, Is there any difference? > > I’m interested in this project and I'm just starting to learn rust, can i work it? #1170 is duplicated. Sure, I assigned it to you. You can DM me in discord if you have any questions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#465
No description provided.