Change in libosmocore[master]: vty_transcript_test.vty: add choice auto-complete tests

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri May 31 19:42:55 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/14307


Change subject: vty_transcript_test.vty: add choice auto-complete tests
......................................................................

vty_transcript_test.vty: add choice auto-complete tests

This patch is a result of discussion we had in [1]. The key idea
is that libosmovty should properly auto-complete the commands
containing choice, such as the following one:

  multi0 (one|two|three)

[1] If9b0c0d031477ca87786aab5c269d00748e896c8

Right now, sending the following command:

  (osmo-foo-bar)# multi0 th

would basically match the following vector:

  multi0 three

however the resulting argv would be:

  ["multi0", "th"]

Moreover, sending the following command:

  (osmo-foo-bar)# multi0 t

would basically match the following vectors:

  multi0 two
  multi0 three

because both start from 't', so the resulting argv would be:

  ["multi0", "t"]

which is ambiguous!

The expected output is:

  (osmo-foo-bar)# multi0 th
  ok argc=1 three

  (osmo-foo-bar)# multi0 t
  % Ambiguous command.

This is going to be fixed in the follow up patches.

Change-Id: I83c3aef813173952641035862c534ef16384780e
---
M tests/vty/vty_transcript_test.vty
1 file changed, 9 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/14307/1

diff --git a/tests/vty/vty_transcript_test.vty b/tests/vty/vty_transcript_test.vty
index 57920a8..27dacdc 100644
--- a/tests/vty/vty_transcript_test.vty
+++ b/tests/vty/vty_transcript_test.vty
@@ -66,3 +66,12 @@
 
 vty_transcript_test> multi2
 ok argc=0
+
+vty_transcript_test> multi0 thr
+ok argc=1 thr
+
+vty_transcript_test> multi1 on
+ok argc=1 on
+
+vty_transcript_test> multi2 t
+ok argc=1 t

-- 
To view, visit https://gerrit.osmocom.org/14307
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83c3aef813173952641035862c534ef16384780e
Gerrit-Change-Number: 14307
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190531/f2209c52/attachment.htm>


More information about the gerrit-log mailing list