Page MenuHomeFreeBSD

printenv: Add test for printenv.
ClosedPublic

Authored by bses30074_gmail.com on Aug 15 2023, 7:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 11 2024, 11:35 AM
Unknown Object (File)
May 11 2024, 6:30 AM
Unknown Object (File)
May 5 2024, 7:50 PM
Unknown Object (File)
May 4 2024, 5:31 AM
Unknown Object (File)
Apr 26 2024, 5:57 AM
Unknown Object (File)
Apr 25 2024, 10:44 PM
Unknown Object (File)
Apr 21 2024, 10:42 AM
Unknown Object (File)
Apr 19 2024, 10:29 PM
Subscribers

Details

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Only simple two test cases.

  1. using echo to check the environment value is correct and the environment variable is actually exist.
  2. try add env and delete the env, then use printenv to check that env.
asomers requested changes to this revision.Sep 21 2023, 3:33 PM
asomers added a subscriber: asomers.
asomers added inline comments.
usr.bin/printenv/tests/Makefile
2–3

You can get rid of the old SVN tag.

usr.bin/printenv/tests/printenv_test.sh
30–32

Also, get rid of the SVN tag here.

37

Let me suggest some more natural English.

42–43

You don't need to invoke awk if you use fancy parameter expansion.

44

This line can be a lot simpler.

52

Let me suggest some more natural English.

56

What is the purpose of this line?

66–67

Inconsistent white space here.

This revision now requires changes to proceed.Sep 21 2023, 3:33 PM
  • Remove unnecessary code and simplify
bses30074_gmail.com marked 5 inline comments as done.
  • Remove unnecessary code and simplify again.
This revision is now accepted and ready to land.Sep 23 2023, 2:36 PM
asomers requested changes to this revision.Sep 23 2023, 2:39 PM
asomers added inline comments.
etc/mtree/BSD.tests.dist
75

This is in the wrong section. Instead of cddl/usr.bin , it should be in usr.bin

This revision now requires changes to proceed.Sep 23 2023, 2:39 PM

In its current state, the "base" test doesn't pass. It seems like the expected_value variable isn't getting correctly expanded. Its value is just the name of the variable. Could you please fix that?

In its current state, the "base" test doesn't pass. It seems like the expected_value variable isn't getting correctly expanded. Its value is just the name of the variable. Could you please fix that?

Yes, expected_value utilizes the value of env_name as a variable name. In a POSIX shell, the primary method to achieve this is through the use of eval. If there is an alternative approach, please feel free to share it. I will update immediately. Thank you for your assistance in reviewing the code, which contained several careless mistakes XD.

This revision is now accepted and ready to land.Sep 25 2023, 4:04 PM
This revision was automatically updated to reflect the committed changes.