-
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
1 parent
5d0bcac
commit 13d8433
Showing
5 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@testset "Zero elements" begin | ||
@test zero(KVector{0,APS}) == KVector{0,APS,Bool}(0) | ||
@test zero(KVector{1,APS}) == KVector{1,APS,Bool}(0, 0, 0) | ||
@test zero(KVector{2,APS}) == KVector{2,APS,Bool}(0, 0, 0) | ||
@test zero(KVector{3,APS}) == KVector{3,APS,Bool}(0) | ||
@test zero(EvenCliffordNumber{APS}) == EvenCliffordNumber{APS,Bool}(0, 0, 0, 0) | ||
@test zero(OddCliffordNumber{APS}) == OddCliffordNumber{APS,Bool}(0, 0, 0, 0) | ||
@test zero(CliffordNumber{APS}) == CliffordNumber{APS,Bool}(0, 0, 0, 0, 0, 0, 0, 0) | ||
end | ||
|
||
@testset "Units" begin | ||
# one | ||
@test one(KVector{0,APS}) == KVector{0,APS,Bool}(1) | ||
@test one(KVector{1,APS}) == KVector{0,APS,Bool}(1) | ||
@test one(KVector{2,APS}) == KVector{0,APS,Bool}(1) | ||
@test one(KVector{3,APS}) == KVector{0,APS,Bool}(1) | ||
@test one(EvenCliffordNumber{APS}) == EvenCliffordNumber{APS,Bool}(1, 0, 0, 0) | ||
@test one(OddCliffordNumber{APS}) == KVector{0,APS,Bool}(1) | ||
@test one(CliffordNumber{APS}) == CliffordNumber{APS,Bool}(1, 0, 0, 0, 0, 0, 0, 0) | ||
# oneunit | ||
@test oneunit(KVector{0,APS}) == KVector{0,APS,Bool}(1) | ||
@test oneunit(EvenCliffordNumber{APS}) == EvenCliffordNumber{APS,Bool}(1, 0, 0, 0) | ||
@test oneunit(CliffordNumber{APS}) == CliffordNumber{APS,Bool}(1, 0, 0, 0, 0, 0, 0, 0) | ||
# these should throw since they can't represent 1 | ||
@test_throws InexactError oneunit(KVector{1,APS}) | ||
@test_throws InexactError oneunit(KVector{2,APS}) | ||
@test_throws InexactError oneunit(KVector{3,APS}) | ||
@test_throws InexactError oneunit(OddCliffordNumber{APS}) | ||
end |
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