whyrusleeping / gx

A package management tool
MIT License
1.88k stars 111 forks source link

test: fix: "install output looks good", added hash #198

Closed schomatis closed 5 years ago

schomatis commented 5 years ago

Fixes test bug introduced in non-PR commit.

Stebalien commented 5 years ago

Still seems a bit off.

schomatis commented 5 years ago

Yes, the elapsed time is missing (I haven't updated my progmeter repo), can a wildcard be used there (e.g., .*?s)? Adding a special time regex seems a bit error prone.

Stebalien commented 5 years ago

Maybe something like ^\[done\]\s\+\[install\]\s\+[0-9]\+[a-z]\+\s\+...?

schomatis commented 5 years ago

Not sure I follow, which is the part for the elapsed time, [0-9]\+[a-z]\+?

Right now the grep regex is something like:

grep "\[done\] \[install\] $pkgA a"

but the gx output with new format has an elapsed time like

[done] [install] 0s    Qmemb8MUvUJC1VRDh8NrpovYJCEGXFfyXGbxccabXXY8G9 b

(although that time is usually 0s), what do you recommend to add to the grep to account for the time string?

Stebalien commented 5 years ago

Yes, that was the [0-9]\+[a-z]\+ part. The other parts were to deal with the variable spacing.

schomatis commented 5 years ago

Ok, I'll add a possible decimal part to the number, but I fear the resulting regex will be harder to read only to accommodate the not-very-relevant time part of the output.

schomatis commented 5 years ago

Yes, that seems better, but I can't get it to work, I'm trying

grep "\[done\] \[install\] [^\s]\+\s\+$pkgA a" install_out

I'm not sure what I'm doing wrong here (I'm definitely missing something), but I'd rather don't spend more time on this issue, let's leave like this.