#!/bin/bash # # Copyright (C) 2019 Matthias Clasen # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. set -euo pipefail #FLATPAK=flatpak . $(dirname $0)/libtest.sh skip_revokefs_without_fuse # This test looks for specific localized strings. export LC_ALL=C echo "1..17" setup_repo install_repo ${FLATPAK} complete "flatpak a" 9 "a" | sort > complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) < complete_out #(diff -u complete_out - || echo "fail") < complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) < complete_out assert_not_file_has_content complete_out "^--system " assert_not_file_has_content complete_out "^--user " assert_not_file_has_content complete_out "^--installation=" done ok "complete NO_DIR commands" for cmd in history info list run update mask \ config install make-current override remote-add repair \ create-usb remote-delete remote-info remote-list remote-ls \ remote-modify search uninstall update; do len=$(awk '{ print length($0) }' <<< "flatpak $cmd --") ${FLATPAK} complete "flatpak $cmd --" $len "--" > complete_out assert_file_has_content complete_out "^--system " assert_file_has_content complete_out "^--user " assert_file_has_content complete_out "^--installation=" done ok "complete non-NO_DIR commands" ${FLATPAK} complete "flatpak list --columns=" 24 "--columns=" | sort > complete_out (diff -u complete_out - || exit 1) < complete_out assert_file_empty complete-out ok "complete list --columns=all" ${FLATPAK} complete "flatpak list --columns=hel" 27 "--columns=hel" | sort > complete_out (diff -u complete_out - || exit 1) < complete_out (diff -u complete_out - || exit 1) <