-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
435 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
def addition_assign(x, y): | ||
x += y | ||
return x | ||
|
||
|
||
def subtraction_assign(x, y): | ||
x -= y | ||
return x | ||
|
||
|
||
def multiplication_assign(x, y): | ||
x *= y | ||
return x | ||
|
||
|
||
def division_assign(x, y): | ||
x /= y | ||
return x | ||
|
||
|
||
def modulus_assign(x, y): | ||
x %= y | ||
return x | ||
|
||
|
||
def floor_division_assign(x, y): | ||
x //= y | ||
return x | ||
|
||
|
||
def exponentiation_assign(x, y): | ||
x **= y | ||
return x | ||
|
||
|
||
def left_shift_assign(x, y): | ||
x <<= y | ||
return x | ||
|
||
|
||
def right_shift_assign(x, y): | ||
x >>= y | ||
return x | ||
|
||
|
||
def bit_or_assign(x, y): | ||
x |= y | ||
return x | ||
|
||
|
||
def bit_xor_assign(x, y): | ||
x ^= y | ||
return x | ||
|
||
|
||
def bit_and_assign(x, y): | ||
x &= y | ||
return x |
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,34 @@ | ||
def equals(a, b): | ||
return a == b | ||
|
||
|
||
def less_than(a, b): | ||
return a < b | ||
|
||
|
||
def less_than_equal(a, b): | ||
return a <= b | ||
|
||
|
||
def greater_than(a, b): | ||
return a > b | ||
|
||
|
||
def greater_than_equal(a, b): | ||
return a >= b | ||
|
||
|
||
def value_is(a, b): | ||
return a is b | ||
|
||
|
||
def value_is_not(a, b): | ||
return a is not b | ||
|
||
|
||
def value_in(a, b): | ||
return a in b | ||
|
||
|
||
def value_not_in(a, b): | ||
return a not in b |
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,49 @@ | ||
from augassign import * | ||
|
||
|
||
def test_addition_assign(): | ||
assert addition_assign(4, 6) == 10 | ||
|
||
|
||
def test_subtraction_assign(): | ||
assert subtraction_assign(6, 4) == 2 | ||
|
||
|
||
def test_multiplication(): | ||
assert multiplication_assign(4, 3) == 12 | ||
|
||
|
||
def test_division(): | ||
assert division_assign(12, 4) == 3 | ||
|
||
|
||
def test_modulus(): | ||
assert modulus_assign(14, 4) == 2 | ||
|
||
|
||
def test_floor_division(): | ||
assert floor_division_assign(14, 4) == 3 | ||
|
||
|
||
def test_exponentiation(): | ||
assert exponentiation_assign(2, 10) == 1024 | ||
|
||
|
||
def test_left_shift(): | ||
assert left_shift_assign(3, 2) == 12 | ||
|
||
|
||
def test_right_shift(): | ||
assert right_shift_assign(15, 2) == 3 | ||
|
||
|
||
def test_bit_or(): | ||
assert bit_or_assign(5, 12) == 13 | ||
|
||
|
||
def test_bit_xor(): | ||
assert bit_xor_assign(5, 12) == 9 | ||
|
||
|
||
def test_bit_and(): | ||
assert bit_and_assign(5, 12) == 4 |
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,41 @@ | ||
from compare import * | ||
|
||
|
||
def test_equals(): | ||
assert equals(3, 3) is True | ||
|
||
|
||
def test_less_than(): | ||
assert less_than(2, 3) is True | ||
assert less_than(2, 2) is False | ||
|
||
|
||
def test_less_than_equal(): | ||
assert less_than_equal(2, 3) is True | ||
assert less_than_equal(2, 2) is True | ||
|
||
|
||
def test_greater_than(): | ||
assert greater_than(3, 2) is True | ||
assert greater_than(2, 2) is False | ||
|
||
|
||
def test_greater_than_equal(): | ||
assert greater_than_equal(3, 2) is True | ||
assert greater_than_equal(2, 2) is True | ||
|
||
|
||
def test_value_is(): | ||
assert value_is(True, True) is True | ||
|
||
|
||
def test_value_is_not(): | ||
assert value_is_not(True, False) is True | ||
|
||
|
||
def test_value_in(): | ||
assert value_in(1, [1, 2, 3]) is True | ||
|
||
|
||
def test_value_not_in(): | ||
assert value_not_in(4, [1, 2, 3]) is True |
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
Oops, something went wrong.