-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #552 from k-okada/check_536
add test to check numbers in node name (#536)
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env roseus | ||
;; | ||
|
||
(require :unittest "lib/llib/unittest.l") | ||
;; remove __name:= to use (ros::roseus node-name) to set node name, otherwise node name is defined form cargs/cargs in ROSEUS() | ||
(print lisp::*eustop-argument*) | ||
(setq node-name (subseq (car (member "__name:=" lisp::*eustop-argument* :test #'substringp)) (length "__name:="))) | ||
(setq node-name (substitute #\_ #\- node-name)) ;; accept '-' in node name | ||
(setf (elt lisp::*eustop-argument* (position "__name:=" lisp::*eustop-argument* :test #'substringp)) | ||
(format nil "noname:=~A" node-name)) | ||
|
||
;; | ||
(ros::roseus node-name :anonymous nil) | ||
|
||
|
||
;; start test | ||
(init-unit-test) | ||
|
||
(deftest test-master () | ||
|
||
(ros::ros-info "get-name ~A" (ros::get-name)) | ||
|
||
(assert (string= (ros::get-name) (format nil "/~A" node-name)) | ||
(format nil "~A == ~A" (ros::get-name) node-name)) | ||
) | ||
|
||
(run-all-tests) | ||
|
||
(exit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<launch> | ||
<!-- Valid characters are a-z, A-Z, 0-9, / and _. --> | ||
|
||
<!-- check normal name --> | ||
<test type="roseus" pkg="roseus" test-name="test_nodename" | ||
args="$(find roseus)/test/test-nodename.l" /> | ||
|
||
<!-- check name with -, only for roseus --> | ||
<test type="roseus" pkg="roseus" test-name="test-nodename" | ||
args="$(find roseus)/test/test-nodename.l" /> | ||
|
||
<!-- check name contins number --> | ||
<test type="roseus" pkg="roseus" test-name="test_nodename123" | ||
args="$(find roseus)/test/test-nodename.l" /> | ||
|
||
<!-- check name contins number --> | ||
<test type="roseus" pkg="roseus" test-name="test_nodenameABC" | ||
args="$(find roseus)/test/test-nodename.l" /> | ||
</launch> |