Giter Club home page Giter Club logo

Comments (6)

scop avatar scop commented on July 16, 2024

Right. To be exact, clearing isn't sufficient with current implementation, and/instead we should set both BASH_COMPLETION_USER_DIR and XDG_DATA_DIRS to values that prevent out-of-tree things from affecting test results.

from bash-completion.

scop avatar scop commented on July 16, 2024

I was trying to reproduce this by copying a version of the ip completion that is known to fail the related unit tests to ~/.local/share/bash-completion/completions/ip, and then ran ./runCompletion ip.exp in the test dir, but it didn't fail, so the test suite obviously ended up not using the faulty one from my home dir. I don't have more time to dig deeper now. Can you post an explicit recipe for reproducing the failure here?

from bash-completion.

rrthomas avatar rrthomas commented on July 16, 2024

I have the following ~/.bash_completion:

# Code copied from /usr/share/bash-completion/bash_completion, with modified
# setting for home directory

BASH_COMPLETION_HOME_DIR=$HOME/.bash_completion.d

# Glob for matching various backup files.
#
_backup_glob='@(#*#|*@(~|.@(bak|orig|rej|swp|dpkg*|rpm@(orig|new|save))))'

for i in $(LC_ALL=C command ls "$BASH_COMPLETION_HOME_DIR"); do
    i=$BASH_COMPLETION_HOME_DIR/$i
    [[ ${i##*/} != @($_backup_glob|Makefile*|$_blacklist_glob) \
           && -f $i && -r $i ]] && . "$i"
done

Other than that, I simply ran all the tests with make check.

from bash-completion.

scop avatar scop commented on July 16, 2024

But in that case, you are sourcing the custom completion files explicitly yourself (bash-completion is not doing that), and using an environment variable that bash-completion itself doesn't use or know about at all (BASH_COMPLETION_HOME_DIR). So clearing that particular one -- or any unknown one for that matter -- is not something that we're going to do in bash-completion. We probably should at least look into avoiding loading of ~/.bash_completion during tests though, if it has potential to cause problems.

from bash-completion.

rrthomas avatar rrthomas commented on July 16, 2024

from bash-completion.

rrthomas avatar rrthomas commented on July 16, 2024

Thanks!

from bash-completion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.