microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
library/src/tests/logical.rs
27lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | use super::test_expression; |
| 5 | use qsc::interpret::Value; |
| 6 | |
| 7 | // Tests for Microsoft.Quantum.Logical namespace |
| 8 | |
| 9 | #[test] |
| 10 | fn check_xor() { |
| 11 | test_expression( |
| 12 | "Microsoft.Quantum.Logical.Xor(false, false)", |
| 13 | &Value::Bool(false), |
| 14 | ); |
| 15 | test_expression( |
| 16 | "Microsoft.Quantum.Logical.Xor(false, true)", |
| 17 | &Value::Bool(true), |
| 18 | ); |
| 19 | test_expression( |
| 20 | "Microsoft.Quantum.Logical.Xor(true, false)", |
| 21 | &Value::Bool(true), |
| 22 | ); |
| 23 | test_expression( |
| 24 | "Microsoft.Quantum.Logical.Xor(true, true)", |
| 25 | &Value::Bool(false), |
| 26 | ); |
| 27 | } |
| 28 | |