XAMPPRocky / tokei

Count your code, quickly.
Other
10.51k stars 502 forks source link

Improve tokei's language test coverage. #63

Open XAMPPRocky opened 7 years ago

XAMPPRocky commented 7 years ago

There should be a file for each language that covers every edge case. The file should contain every variant comments and quotes, as well as a comment at the top of the file containing the manually verified lines, code, comments, blanks e.g. // 39 lines 32 code 2 comments 5 blanks. A good example of a test file is tests/data/rust.rs.

// 39 lines 32 code 2 comments 5 blanks

/* /**/ */
fn main() {
    let start = "/*";
    loop {
        if x.len() >= 2 && x[0] == '*' && x[1] == '/' { // found the */
            break;
        }
    }
}

fn foo() {
    let this_ends = "a \"test/*.";
    call1();
    call2();
    let this_does_not = /* a /* nested */ comment " */
        "*/another /*test
            call3();
            */";
}

fn foobar() {
    let does_not_start = // "
        "until here,
        test/*
        test"; // a quote: "
    let also_doesnt_start = /* " */
        "until here,
        test,*/
        test"; // another quote: "
}

fn foo() {
    let a = 4; // /*
    let b = 5;
    let c = 6; // */
}

Languages

Emulebest commented 6 years ago

I could start working on some languages on the weekends if it is okay for the terms

XAMPPRocky commented 6 years ago

@Emulebest Contribute when you can. All contributions are welcome.

JHaig343 commented 4 years ago

I'd also like to help with some language tests as part of Hacktoberfest this year.

XAMPPRocky commented 4 years ago

@JHaig343 Sure!

JHaig343 commented 4 years ago

@XAMPPRocky I noticed that proper execution of the test file requires the top comment to be in the file and in the correct format(X lines X code X comments X blanks). The contributing doc for Tests does not mention that the format is required. Would I be able to make a PR to explicitly state the required format in CONTRIBUTING.md?