Unit Test expecting 57, 123; code review
还没有人认领这个 Issue。
评估
调研方向
从 antlr4cpp/antlr/test/test_interval_set.cpp 和 test_mixed_ranges_and_elements() 方法开始。将其预期的区间字符串与所示的 Java 实现进行比较,并运行相关的 C++ 单元测试。当测试期望或区间行为得到确认,并与预期的包含端点范围语义保持一致时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hello,
Inspiring on C ++ test for my unit tests in C, I noticed an error in the expecting result. Maybe the +1 has no effect?
In https://github.com/antlr/antlr4-cpp/blob/master/antlr4cpp/antlr/test/test_interval_set.cpp
void test_mixed_ranges_and_elements()
{
interval_set s;
s.insert(1);
s.insert(std::make_pair(L'a',L'z'+1));
s.insert(std::make_pair(L'0',L'9'+1));
std::wstring expecting = L"{1, 48..57, 97..122}";
}
by comparison with Java implementation
IntervalSet interval_set = new IntervalSet();
interval_set.add(1);
interval_set.add('a', 'z'+1);
interval_set.add('0', '9'+1);
String str = interval_set.toString();
String expecting = "{1, 48..58, 97..123}";
PS:
C ++ operator overloading is friendly
interval_set s;
s << 1;// s+1 is ambigus
s << interval('a', 'z'+1);
s &= interval('0', '9'+1);
s |= interval('0', '9'+1);
std::cout << s << std::endl;
- 主要语言
- C++
- 星标
- 80
- 派生
- 33
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
antlr/antlr4-cpp 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 30/100
antlr/antlr4-cpp#14 ·
-
难度 5/5 一周以上 新手友好度 20/100
antlr/antlr4-cpp#13 ·
-
难度 4/5 3-5 天 新手友好度 25/100
antlr/antlr4-cpp#12 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
antlr/antlr4-cpp#11 ·
相似的 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
Unconfirmed bug
难度 1/5 1 小时以内 新手友好度 88/100
luanti-org/luanti#17605 · 1 条评论 ·
维护者通常 2 天内回复
-
area: config area: firmware priority: P2 - medium size: S type: bug
难度 2/5 1-3 小时 新手友好度 76/100
Mizithra/ActiveTerrain#16 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
grumpycoders/pcsx-redux#2171 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复