Skip to content
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

match keyword in not working properly #1179

Closed
ajitqait opened this issue Jun 18, 2020 · 6 comments
Closed

match keyword in not working properly #1179

ajitqait opened this issue Jun 18, 2020 · 6 comments
Assignees

Comments

@ajitqait
Copy link

Scenario: Demo purpose
Given def a = 'false' // String
And print a
And def b = false //boolean
Then match a == b //should be failed

Actual: passed(a==b) but when swap 'a' and 'b' then it is failed(b==a)(in this case working fine)
expected: it should be failed.

@ptrthomas
Copy link
Member

ptrthomas commented Jun 18, 2020

duplicate #1178

@ajitqait
Copy link
Author

@ptrthomas can you please tell me in which version it is fixed??

@ptrthomas
Copy link
Member

@ajitqait I haven't read your issue. you have to follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

@guptanatya
Copy link

guptanatya commented Jun 18, 2020

Yes I am too facing this type of issue using match
Scenario: Validate the test
Given string a = 3
And def b = 3
And match a == b

The scenario is passed instead of getting failed and I am not able to refer any reference link for help

@ptrthomas ptrthomas self-assigned this Jun 18, 2020
@ptrthomas ptrthomas added bug and removed duplicate labels Jun 18, 2020
@ptrthomas ptrthomas added this to the 0.9.6 milestone Jun 18, 2020
@ptrthomas
Copy link
Member

ptrthomas commented Jun 18, 2020

@guptanatya thank you - that is a much better example

this is normally never used because match is designed for JSON. for example this will fail as you expect:

* def foo = { a: '3' }
* def bar = { a: 3 }
* match foo == bar

that said, I will look into the bug you have raised, but I don't consider it a priority at all.

you can use assert and it will work exactly as you expect. any questions ?

Given string a = 3
And def b = 3
And assert a === b

@ptrthomas
Copy link
Member

0.9.6 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants