flatstr icon indicating copy to clipboard operation
flatstr copied to clipboard

Is the flattened representation itself not actually verified in tests?

Open dead-claudia opened this issue 6 years ago • 2 comments

You could check the result by using string->isFlat() in a native C++ (not N-API) addon used specifically for testing. It's undocumented, but exposed publicly. This would make it way less brittle to check.

dead-claudia avatar Sep 12 '19 06:09 dead-claudia

Yes, I think it would Would you like to send a PR for this?

mcollina avatar Sep 12 '19 11:09 mcollina

I think this is cool but I'd like to do it the following way:

  1. create and publish a C++ node module that returns string->isFlat()
  2. change test field of this module to npm install --no-save is-flat && tap

The reasoning for this is I'd rather not add a C++ build to installs, not even for dev – especially because it's fairly common in the wild for dev deps to sneak into deps, which would then cause an error in production, esp. in a docker container, and then it would seem to be flatstr causing the problem etc. etc.

davidmarkclements avatar Sep 12 '19 17:09 davidmarkclements