{"action":"created","issue":{"url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework/issues/18","repository_url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework","labels_url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework/issues/18/comments","events_url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework/issues/18/events","html_url":"https://github.com/byte-physics/igor-unit-testing-framework/issues/18","id":367443934,"node_id":"MDU6SXNzdWUzNjc0NDM5MzQ=","number":18,"title":"CHECK_EQUAL_VAR(<null>, NaN) passes","user":{"login":"MichaelHuth","id":29093275,"node_id":"MDQ6VXNlcjI5MDkzMjc1","avatar_url":"https://avatars3.githubusercontent.com/u/29093275?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelHuth","html_url":"https://github.com/MichaelHuth","followers_url":"https://api.github.com/users/MichaelHuth/followers","following_url":"https://api.github.com/users/MichaelHuth/following{/other_user}","gists_url":"https://api.github.com/users/MichaelHuth/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelHuth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelHuth/subscriptions","organizations_url":"https://api.github.com/users/MichaelHuth/orgs","repos_url":"https://api.github.com/users/MichaelHuth/repos","events_url":"https://api.github.com/users/MichaelHuth/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelHuth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-06T10:18:08Z","updated_at":"2018-10-07T11:14:30Z","closed_at":null,"author_association":"MEMBER","body":"Using a NVAR reference which is `<null>`, when comparing with `CHECK_EQUAL_VAR(ref, NaN)` it passes.\r\nI would expect the check to fail.\r\n\r\nThe problem is that a `<null>` NVAR gets implicitly converted to NaN when passed by value into CHECK_EQUAL_VAR and thus it compares equal. \r\n\r\nAlso `variable num = invalid_ref` results in num = NaN and Igor does not throw an error.\r\n\r\nIf one does the same for strings Igor throws an error with 'attempt to use a <null> string'.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework/issues/comments/427645054","html_url":"https://github.com/byte-physics/igor-unit-testing-framework/issues/18#issuecomment-427645054","issue_url":"https://api.github.com/repos/byte-physics/igor-unit-testing-framework/issues/18","id":427645054,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzY0NTA1NA==","user":{"login":"t-b","id":1185677,"node_id":"MDQ6VXNlcjExODU2Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/1185677?v=4","gravatar_id":"","url":"https://api.github.com/users/t-b","html_url":"https://github.com/t-b","followers_url":"https://api.github.com/users/t-b/followers","following_url":"https://api.github.com/users/t-b/following{/other_user}","gists_url":"https://api.github.com/users/t-b/gists{/gist_id}","starred_url":"https://api.github.com/users/t-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-b/subscriptions","organizations_url":"https://api.github.com/users/t-b/orgs","repos_url":"https://api.github.com/users/t-b/repos","events_url":"https://api.github.com/users/t-b/events{/privacy}","received_events_url":"https://api.github.com/users/t-b/received_events","type":"User","site_admin":false},"created_at":"2018-10-07T11:14:30Z","updated_at":"2018-10-07T11:14:30Z","author_association":"MEMBER","body":"@MichaelHuth \r\n\r\nThanks for the report. I was not aware of that issue. Any ideas for how we could fix/work around that? The implicit-conversion-to-nan sounds like an Igor issue to me.\r\n\r\nDoes it also fail with `rtFunctionErrors=1`?\r\n\r\n As in\r\n\r\n```igorpro\r\n#pragma rtGlobals=3\r\n#pragma rtFunctionErrors=1\r\n\r\nFunction Test()\r\n\r\n    NVAR/Z I_DONT_EXIST\r\n\r\n    CHECK_EQUAL_VAR(0, I_DONT_EXIST)\r\nEnd\r\n```\r\n\r\nI would guess that the reason why `*_EQUAL_STR` fails is that these functions take the string argument by reference and you can not pass a SVAR as string reference."}}
{"actor":{"display_login":"t-b"}}