summaryrefslogtreecommitdiff
path: root/test/example/hash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/example/hash.cpp')
-rw-r--r--test/example/hash.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/example/hash.cpp b/test/example/hash.cpp
index 7c3882cc9..ba9ca24ea 100644
--- a/test/example/hash.cpp
+++ b/test/example/hash.cpp
@@ -138,5 +138,15 @@ int main() {
y.index = 11;
assertNotEqual(x, y);
}
+ {
+ // It is ok to hash something that refers to an unknown name, like a break
+ // without the outside context that it branches to. And different names
+ // should have different hashes.
+ Break x;
+ x.name = "foo";
+ Break y;
+ y.name = "bar";
+ assertNotEqual(x, y);
+ }
std::cout << "success.\n";
}