lsd icon indicating copy to clipboard operation
lsd copied to clipboard

increasing code coverage issue #46

Open michabs opened this issue 2 years ago • 4 comments


TODO

  • [x] Use cargo fmt
  • [x] Add necessary tests
  • [x] Add changelog entry
  • [x] Update default config/theme in README (if applicable)
  • [x] Update man page at lsd/doc/lsd.md (if applicable)

michabs avatar Jun 25 '23 12:06 michabs

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: michabs

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

muniu-bot[bot] avatar Jun 25 '23 13:06 muniu-bot[bot]

hi @michabs, thanks for contributing, your code seems not to pass the test, you can test locally by

cargo test

zwpaper avatar Jul 13 '23 03:07 zwpaper

Shalom. I know. I was wondering if you can assist me with this issue: trying to write a test that set the color of colorstring from Color This is a code snippet let colors = Colors::new(color::ThemeOption::Default); assert_eq!( " directory".to_string().with(colors. <???> ), 10x

On Thu, Jul 13, 2023 at 6:34 AM Wei Zhang @.***> wrote:

hi @michabs https://github.com/michabs, thanks for contributing, you code seems not passing the test, you can run test locally by

— Reply to this email directly, view it on GitHub https://github.com/lsd-rs/lsd/pull/862#issuecomment-1633496061, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZXNWKA6G7FADEFYLT2E43XP5UD5ANCNFSM6AAAAAAZTEM2XA . You are receiving this because you were mentioned.Message ID: @.***>

michabs avatar Jul 13 '23 07:07 michabs

hi @michabs, sorry for the late reply, please feel free to ask any questions.

you can refer to https://github.com/lsd-rs/lsd/blob/master/src/color.rs#L204C12-L204C20 and use it like https://github.com/lsd-rs/lsd/blob/8acaabec723cdd71b498212c8a47ac952d022738/src/meta/symlink.rs#L60,

or refer to https://github.com/lsd-rs/lsd/blob/8acaabec723cdd71b498212c8a47ac952d022738/src/meta/symlink.rs#L59C2-L59C2 to create a ColoredString directly.

please let me know if I misunderstood your question or if it did not help.

zwpaper avatar Jul 28 '23 14:07 zwpaper