blob: 633fabb1753514303fec6d8799c9f117316cb967 [file] [log] [blame]
source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
variable ly_cleanup {
ly_ignore
ly_exit
}
test completion_hints_ietf_ip {Completion and hints for ietf-ip.yang} {
-setup $ly_setup -cleanup $ly_cleanup -body {
ly_cmd "add $::env(YANG_MODULES_DIR)/ietf-ip.yang"
# completion and hint
ly_completion "print -f info -P " "print -f info -P /ietf-"
set hints {"/ietf-yang-schema-mount:schema-mounts" "/ietf-interfaces:interfaces" "/ietf-interfaces:interfaces-state"}
ly_hint "" "print -f info -P /ietf-" $hints
# double completion
ly_completion "i" "print -f info -P /ietf-interfaces:interfaces"
ly_completion "/" "print -f info -P /ietf-interfaces:interfaces/interface"
# a lot of hints
set hints {"/ietf-interfaces:interfaces/interface"
"/ietf-interfaces:interfaces/interface/name" "/ietf-interfaces:interfaces/interface/description"
"/ietf-interfaces:interfaces/interface/type" "/ietf-interfaces:interfaces/interface/enabled"
"/ietf-interfaces:interfaces/interface/link-up-down-trap-enable"
"/ietf-interfaces:interfaces/interface/ietf-ip:ipv4" "/ietf-interfaces:interfaces/interface/ietf-ip:ipv6"
}
ly_hint "" "print -f info -P /ietf-interfaces:interfaces/interface" $hints
# double tab
ly_completion "/i" "print -f info -P /ietf-interfaces:interfaces/interface/ietf-ip:ipv"
ly_completion "4" "print -f info -P /ietf-interfaces:interfaces/interface/ietf-ip:ipv4"
set hints { "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4" "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/enabled"
"/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/forwarding" "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/mtu"
"/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/address" "/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/neighbor"
}
ly_hint "\t" "print -f info -P /ietf-interfaces:interfaces/interface/ietf-ip:ipv" $hints
# no more completion
ly_completion "/e" "print -f info -P /ietf-interfaces:interfaces/interface/ietf-ip:ipv4/enabled "
}}
cleanupTests