Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BIRD Internet Routing Daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
101c5a50
Commit
101c5a50
authored
Nov 09, 2016
by
Ondřej Zajíček
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter: Add long community tests
Based on Pavel Tvrdik's int-test-lc branch.
parent
9b0a0ba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
filter/test.conf
filter/test.conf
+65
-0
No files found.
filter/test.conf
View file @
101c5a50
...
...
@@ -278,6 +278,71 @@ bt_test_suite(t_extended_community_list, "Testing extended communities and lists
/*
*
Testing
Long
Communities
* ------------------------
*/
function
mktrip
(
int
a
)
{
return
(
a
,
2
*
a
,
3
*
a
);
}
function
t_long_community_list
()
lclist
ll
;
lclist
ll2
;
{
ll
= ---
empty
---;
ll
=
add
(
ll
, (
ten
,
20
,
30
));
ll
=
add
(
ll
, (
1000
,
2000
,
3000
));
ll
=
add
(
ll
,
mktrip
(
100000
));
print
"LC list (10, 20, 30) (1000, 2000, 3000) (100000, 200000, 300000)"
;
print
ll
;
bt_assert
(
ll
.
len
=
3
);
bt_assert
(
ll
=
add
(
add
(
add
(---
empty
---, (
10
,
20
,
30
)), (
1000
,
2000
,
3000
)), (
100000
,
200000
,
300000
)));
bt_assert
(
mktrip
(
1000
) ~
ll
);
bt_assert
(
mktrip
(
100
) !~
ll
);
bt_assert
(
ll
~ [(
5
,
10
,
15
), (
10
,
20
,
30
)]);
bt_assert
(
ll
~ [(
10
,
15
..
25
,*)]);
bt_assert
(
ll
~ [(
ten
, *, *)]);
bt_assert
(
ll
!~ [(
5
,
10
,
15
), (
10
,
21
,
30
)]);
bt_assert
(
ll
!~ [(
10
,
21
..
25
,*)]);
bt_assert
(
ll
!~ [(
11
, *, *)]);
ll2
=
filter
(
ll
, [(
5
..
15
, *, *), (
100000
,
500
..
500000
, *)]);
bt_assert
(
ll2
=
add
(
add
(---
empty
---, (
10
,
20
,
30
)), (
100000
,
200000
,
300000
)));
ll
= ---
empty
---;
ll
=
add
(
ll
, (
10
,
10
,
10
));
ll
=
add
(
ll
, (
20
,
20
,
20
));
ll
=
add
(
ll
, (
30
,
30
,
30
));
ll2
= ---
empty
---;
ll2
=
add
(
ll2
, (
20
,
20
,
20
));
ll2
=
add
(
ll2
, (
30
,
30
,
30
));
ll2
=
add
(
ll2
, (
40
,
40
,
40
));
print
"lclist A (10,20,30): "
,
ll
;
print
"lclist B (30,40,50): "
,
ll2
;
print
"lclist A union B: "
,
add
(
ll
,
ll2
);
bt_assert
(
add
(
ll
,
ll2
) =
add
(
add
(
add
(
add
(---
empty
---, (
10
,
10
,
10
)), (
20
,
20
,
20
)), (
30
,
30
,
30
)), (
40
,
40
,
40
)));
print
"lclist A isect B: "
,
filter
(
ll
,
ll2
);
bt_assert
(
filter
(
ll
,
ll2
) =
add
(
add
(---
empty
---, (
20
,
20
,
20
)), (
30
,
30
,
30
)));
print
"lclist A \ B: "
,
delete
(
ll
,
ll2
);
bt_assert
(
delete
(
ll
,
ll2
) =
add
(---
empty
---, (
10
,
10
,
10
)));
}
bt_test_suite
(
t_long_community_list
,
"Testing long communities and lists"
);
/*
*
Testing
defined
()
function
* --------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment