-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for several tests in test_bool (#261)
* Fixes for several tests in test_bool * Merge in from IronLanguages/main#1332
- Loading branch information
Showing
4 changed files
with
78 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
##################################################################################### | ||
# | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# | ||
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A | ||
# copy of the license can be found in the License.html file at the root of this distribution. If | ||
# you cannot locate the Apache License, Version 2.0, please send an email to | ||
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound | ||
# by the terms of the Apache License, Version 2.0. | ||
# | ||
# You must not remove this notice, or any other, from this software. | ||
# | ||
# | ||
##################################################################################### | ||
|
||
from iptest.assert_util import * | ||
|
||
from System import Nullable | ||
|
||
def test_object(): | ||
a = object() | ||
b = object() | ||
|
||
AssertEqual(True, a is a) | ||
AssertEqual(False, a is b) | ||
AssertEqual(False, a is not a) | ||
AssertEqual(True, a is not b) | ||
|
||
def test_bool_nullablebool(): | ||
tc = [ | ||
# (a, b, a is b) | ||
(True, True, True), | ||
(True, False, False), | ||
(Nullable[bool](True), True, True), # https://github.com/IronLanguages/main/issues/1299 | ||
(Nullable[bool](True), False, False), | ||
(Nullable[bool](False), True, False), # dito | ||
(Nullable[bool](False), False, True), | ||
(None, True, False), | ||
(None, False, False), | ||
] | ||
|
||
for a, b, result in tc: | ||
AssertEqual(result, a is b) | ||
AssertEqual(result, b is a) | ||
AssertEqual(not result, a is not b) | ||
AssertEqual(not result, b is not a) |