1 //===-- FunctionTests.cpp -------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "support/Function.h"
10 #include "gmock/gmock.h"
11 #include "gtest/gtest.h"
17 TEST(EventTest
, Subscriptions
) {
21 Event
<int>::Subscription SubA
;
22 // No subscriptions are active.
26 Event
<int>::Subscription SubB
= E
.observe([&](int) { ++N
; });
31 SubA
= E
.observe([&](int) { ++N
; });
37 SubA
= std::move(SubB
);