Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yew_macro test refactoring, extract ...-pass.rs tests under modules #2271

Open
Madoshakalaka opened this issue Dec 15, 2021 · 0 comments
Open
Labels
A-ci Area: The continuous integration

Comments

@Madoshakalaka
Copy link
Contributor

Problem

(This is a code quality/refactoring suggestion. I think we need a template for that?)

Currently, the shadowing is repeated in each ...-pass.rs file, that's a lot of duplication and can be extracted into a prelude.

#![no_implicit_prelude]

// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub struct i16;
#[allow(non_camel_case_types)]
pub struct i32;
#[allow(non_camel_case_types)]
pub struct i64;
#[allow(non_camel_case_types)]
pub struct i8;
#[allow(non_camel_case_types)]
pub struct isize;
#[allow(non_camel_case_types)]
pub struct str;
#[allow(non_camel_case_types)]
pub struct u128;
#[allow(non_camel_case_types)]
pub struct u16;
#[allow(non_camel_case_types)]
pub struct u32;
#[allow(non_camel_case_types)]
pub struct u64;
#[allow(non_camel_case_types)]
pub struct u8;
#[allow(non_camel_case_types)]
pub struct usize;

Also, those files currently are executed by try_build and are not parts of the module tree so IDE doesn't provide code analysis.
It's hard to compose or edit tests. Extracting them into modules makes it easier.

Questionnaire

  • I would like to fix this
@WorldSEnder WorldSEnder added A-ci Area: The continuous integration and removed bug labels May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: The continuous integration
Projects
None yet
Development

No branches or pull requests

2 participants