Skip to content

Manual tests #41

@iboukhss

Description

@iboukhss

From: https://neon-naiad-9db266.netlify.app/cursus/minishell/

Simple command and global variable

  • Simple command with absolute path like /bin/ls
  • Single global variable to provide signal information
  • Empty, tabs, spaces

Arguments

  • Simple command with an absolute path and arguments like /bin/ls -la

echo

  • echo command with or without arguments and the -n option

exit

  • exit command with or without arguments

Return value of a process

  • Simple command with an absolute path like /bin/ls and echo $?
  • Value is correct
  • Value is correct with wrong commands
  • $? + $?

Signals

  • Ctrl-C displays a new line with a prompt
  • Ctrl-\ does nothing
  • Ctrl-D quits
  • Ctrl-C in a prompt after writing some stuff displays a new line with a new prompt
  • Buffer is clean after pressing enter
  • Ctrl-D in a prompt after writing some stuff does nothing
  • Ctrl-\ in a prompt after writing some stuff does nothing
  • Ctrl-C after running a blocking command like cat or grep "something"
  • Ctrl-\ after running a blocking command like cat or grep "something"
  • Ctrl-D after running a blocking command like cat or grep "something"

Double quotes

  • Simple command with arguments and double quotes (with whitespaces too)
  • Command like echo "cat lol.c | cat > lol.c"

Single quotes

  • Command with single quotes as arguments
  • Empty arguments
  • Environment variables, whitespaces, pipes, redirections in single quotes
  • echo '$USER' prints "$USER"
  • Nothing should be interpreted?

env

  • env shows the current environment variables

export

  • Export environment variables, create new ones, replace old ones
  • Check the result with env

unset

  • Export environment variables, create new ones, replace old ones
  • Unset to remove some of them
  • Check the result with env

cd

  • cd to move the working directory and check with /bin/ls
  • Check with wrong directories
  • Try with . and .. as arguments

pwd

  • pwd command
  • Check in multiple directories

Relative path

  • Commands with relative paths
  • Check in multiple (complex) directories

Environment path

  • Commands without any path like ls, wc, awk, ect.
  • Unset the $PATH and execute commands
  • Set the $PATH to a multiple value directory and ensure values are checked left to right (directory1:directory2)

Redirection

  • Commands with redirections < and >
  • Change > to >>
  • Check for random failure
  • Test << (it doesn't have to update history)

Pipes

  • Commands like cat file | grep bla | more
  • Check with wrong arguments
  • Mix pipes and redirections

Go Crazy and history

  • Type something and Ctrl-C and then press Enter, buffer should be clean
  • Navigate up and down, retry a command
  • Wrong commands don't crash and prints error
  • cat | cat | ls
  • Long command with tons of arguments

Environment variables

  • echo with some environment variables $variable
  • Check that $ is interpreted as an environment variable
  • Check that double quotes interpolate $
  • echo $USER

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions