From Fedora Project Wiki

Revision as of 08:37, 17 August 2023 by Sumantrom (talk | contribs) (Created page with "{{QA/Test_Case |description=This test case validates that the `diffutils` package is functioning as expected by creating two sample files and comparing them using the `diff` command. |setup=Ensure that the `diffutils` package is installed by executing the following command: sudo dnf install diffutils |actions= # Create two different sample text files: # echo "hello world" > file1.txt # echo "hello world2" > file2.txt # Use the `diff` command to compare the two files: # d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This test case validates that the diffutils package is functioning as expected by creating two sample files and comparing them using the diff command.

Setup

Ensure that the diffutils package is installed by executing the following command: sudo dnf install diffutils

How to test

  1. Create two different sample text files:
  2. echo "hello world" > file1.txt
  3. echo "hello world2" > file2.txt
  4. Use the diff command to compare the two files:
  5. diff file1.txt file2.txt

Expected Results

  1. The diff command should produce output indicating the lines that are different between the two files. For this example, the output should look like:
  2. 1c1
  3. < hello world
  4. ---
  5. > hello world2

Optional

For exploratory testing:

  1. Modify one of the files and re-run the diff command to observe different outputs.
  2. Use different options with the diff command, such as -y for side-by-side comparison.