Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
eab39a8a
Commit
eab39a8a
authored
Jul 24, 2019
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add few missing tests
parent
5e639ce8
No related branches found
No related tags found
1 merge request
!37
Feature/language
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_SymbolTable.cpp
+8
-0
8 additions, 0 deletions
tests/test_SymbolTable.cpp
with
8 additions
and
0 deletions
tests/test_SymbolTable.cpp
+
8
−
0
View file @
eab39a8a
...
...
@@ -13,14 +13,19 @@ TEST_CASE("SymbolTable", "[language]")
using
namespace
TAO_PEGTL_NAMESPACE
;
position
begin_position
{
internal
::
iterator
{
"fixture"
},
"fixture"
};
begin_position
.
byte
=
2
;
auto
[
i_symbol_a
,
created_a
]
=
root_st
->
add
(
"a"
,
begin_position
);
REQUIRE
(
created_a
);
REQUIRE
(
i_symbol_a
->
second
.
position
().
byte
==
2
);
// Check that one cannot build another "a" in this table
REQUIRE
(
not
root_st
->
add
(
"a"
,
begin_position
).
second
);
position
use_position
{
internal
::
iterator
{
"fixture"
},
"fixture"
};
use_position
.
byte
=
3
;
// after declarative position
auto
[
i_search_a
,
found_a
]
=
root_st
->
find
(
"a"
,
use_position
);
REQUIRE
(
found_a
);
REQUIRE
(
i_search_a
==
i_symbol_a
);
...
...
@@ -65,6 +70,9 @@ TEST_CASE("SymbolTable", "[language]")
REQUIRE
(
std
::
holds_alternative
<
double
>
(
attributes_a
.
value
()));
const
auto
const_attribute_a
=
attributes_a
;
REQUIRE
(
std
::
get
<
double
>
(
const_attribute_a
.
value
())
==
2.3
);
{
std
::
stringstream
value_output
;
value_output
<<
attributes_a
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment