-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Allow magic in Node API #958
Conversation
tests/node/tests/operations.mjs
Outdated
@@ -1076,5 +1076,296 @@ ExifImageHeight: 57`); | |||
}), | |||
|
|||
|
|||
it("performs MAGIC", async () => { | |||
const input = "WUagwsiae6mP8gNtCCLUFpCpCB26RmBDoDD8PacdAmzAzBVjkK2QstFXaKhpC6iUS7RHqXrJtFisoRSgoJ4whjm1arm864qaNq4RcfUmLHrcsAaZc5TXCYifNdgS83gDeejGX46gaiMyuBV6EskHt1scgJ88x2tNSotQDwbGY1mmCob2ARGFvCKYNqiN9ipMq1ZU1mgkdbNuGcb76aRtYWhCGUc8g93UJudhb8htsheZnwTpgqhx83SVJSZXMXUjJT2zmpC7uXWtumqokbdSi88YtkWDAc1Toouh2oH4D4ddmNKJWUDpMwmngUmK14xwmomccPQE9hM172APnSqwxdKQ172RkcAsysnmj5gGtRmVNNh2s359wr6mS2QRP"; | |||
const output = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic output is likely to change on a reasonably regular basis as we tweak settings. I'd rather this test wasn't quite so specific otherwise we'll have to change it continuously!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, fair. I'll spend some time thinking about which parts of this are important to test for.
…ighlights when a file type has been detected.
…operations to categories.
Certain RTF files may attempt to thwart detection by having a malformed RTF header, such as **{\rt000**. Removing 0x66 will result in detecting these malformed yet valid RTFs as well. Additional reading: https://www.decalage.info/rtf_tricks#Trick_1:_Incomplete_RTF_Header
e15fb51
to
09bfb12
Compare
@n1474335 I've tweaked the assertions on the magic operation output so it just checks for the correct structure and properties, rather than specific values. Sorry the messy rebase, I won't be trying that again. |
@n1474335 I've updated the magic tests on the API to reflect the new magic lib output. There are three properties which are now consistently Here are the logs of the last suggestion in the sample output from the test in
|
Closed in favour of #1049 |
This PR adds a special case for flowControl operations in the node wrapper, so that the Magic operation can be called through the Node API.
This has only been tested with the magic operation at the moment. Other flowcontrol operations can be replicated using the client code's conditionals, but I will look at ensuring the other flowcontrol operations work in the future.
Closes #959