@@ -48,32 +48,26 @@ TEST(Type, GetTypeScopeAndBasename) {
4848}
4949
5050TEST (Type, CompilerContextPattern) {
51- std::vector<CompilerContext> mms = {
52- {CompilerContextKind::Module, ConstString (" A" )},
53- {CompilerContextKind::Module, ConstString (" B" )},
54- {CompilerContextKind::Struct, ConstString (" S" )}};
55- EXPECT_TRUE (contextMatches (mms, mms));
5651 std::vector<CompilerContext> mmc = {
5752 {CompilerContextKind::Module, ConstString (" A" )},
5853 {CompilerContextKind::Module, ConstString (" B" )},
59- {CompilerContextKind::Class, ConstString (" S" )}};
60- EXPECT_FALSE (contextMatches (mms, mmc));
61- std::vector<CompilerContext> ms = {
54+ {CompilerContextKind::ClassOrStruct, ConstString (" S" )}};
55+ std::vector<CompilerContext> mc = {
6256 {CompilerContextKind::Module, ConstString (" A" )},
63- {CompilerContextKind::Struct , ConstString (" S" )}};
64- std::vector<CompilerContext> mas = {
57+ {CompilerContextKind::ClassOrStruct , ConstString (" S" )}};
58+ std::vector<CompilerContext> mac = {
6559 {CompilerContextKind::Module, ConstString (" A" )},
6660 {CompilerContextKind::AnyModule, ConstString (" *" )},
67- {CompilerContextKind::Struct , ConstString (" S" )}};
68- EXPECT_TRUE (contextMatches (mms, mas ));
69- EXPECT_TRUE (contextMatches (ms, mas ));
70- EXPECT_FALSE (contextMatches (mas, ms ));
71- std::vector<CompilerContext> mmms = {
61+ {CompilerContextKind::ClassOrStruct , ConstString (" S" )}};
62+ EXPECT_TRUE (contextMatches (mmc, mac ));
63+ EXPECT_TRUE (contextMatches (mc, mac ));
64+ EXPECT_FALSE (contextMatches (mac, mc ));
65+ std::vector<CompilerContext> mmmc = {
7266 {CompilerContextKind::Module, ConstString (" A" )},
7367 {CompilerContextKind::Module, ConstString (" B" )},
7468 {CompilerContextKind::Module, ConstString (" C" )},
75- {CompilerContextKind::Struct , ConstString (" S" )}};
76- EXPECT_TRUE (contextMatches (mmms, mas ));
69+ {CompilerContextKind::ClassOrStruct , ConstString (" S" )}};
70+ EXPECT_TRUE (contextMatches (mmmc, mac ));
7771 std::vector<CompilerContext> mme = {
7872 {CompilerContextKind::Module, ConstString (" A" )},
7973 {CompilerContextKind::Module, ConstString (" B" )},
@@ -83,7 +77,7 @@ TEST(Type, CompilerContextPattern) {
8377 {CompilerContextKind::Module, ConstString (" B" )},
8478 {CompilerContextKind::AnyType, ConstString (" S" )}};
8579 EXPECT_TRUE (contextMatches (mme, mma));
86- EXPECT_TRUE (contextMatches (mms , mma));
80+ EXPECT_TRUE (contextMatches (mmc , mma));
8781 std::vector<CompilerContext> mme2 = {
8882 {CompilerContextKind::Module, ConstString (" A" )},
8983 {CompilerContextKind::Module, ConstString (" B" )},
0 commit comments