aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-22 17:14:15 +0100
committerAdrian Kummerlaender2015-02-22 17:14:15 +0100
commit41b63eff7f76e6574ef238f821dad0212a619c2a (patch)
tree291652f853e32c80183fd1178d470c5499eee1c5 /test.cc
parent18fe83991563c0072fabaa60ff161e781a5364c2 (diff)
downloadTypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.gz
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.bz2
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.lz
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.xz
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.zst
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.zip
Improved `simulate` function of the Turing machine example
* introduced `state::state_accessor` helper function and moved position logic into `updatePosition` * added `IsEqual` comparator and expressed other basic comparators in terms of itself
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/test.cc b/test.cc
index 774f9be..44c0f6f 100644
--- a/test.cc
+++ b/test.cc
@@ -33,6 +33,28 @@ int main(int, char **) { }
static_assert(
std::is_same<
tav::Boolean<true>,
+ tav::IsEqual<
+ tav::Pair<tav::Int<1>, tav::Int<2>>,
+ tav::Pair<tav::Int<1>, tav::Int<2>>
+ >
+ >::value,
+ "(IsEqual '(1 . 2) '(1 . 2)) != #t"
+);
+
+static_assert(
+ std::is_same<
+ tav::Boolean<false>,
+ tav::IsEqual<
+ tav::Pair<tav::Int<1>, tav::Int<2>>,
+ tav::Pair<tav::Int<2>, tav::Int<3>>
+ >
+ >::value,
+ "(IsEqual '(1 . 2) '(2 . 3)) != #f"
+);
+
+static_assert(
+ std::is_same<
+ tav::Boolean<true>,
tav::IsEqualType<tav::Int<1>, tav::Int<2>>
>::value,
"(IsEqualType 1 2) != #t"