Skip to content

test(cli): verify dotenv export round trips - #189

Merged
Maxerns merged 1 commit into
getsotto:mainfrom
Akimbo92i:test/187-dotenv-round-trip
Sep 10, 2026
Merged

test(cli): verify dotenv export round trips#189
Maxerns merged 1 commit into
getsotto:mainfrom
Akimbo92i:test/187-dotenv-round-trip

Conversation

@Akimbo92i

Copy link
Copy Markdown
Contributor

Summary

Add regression coverage proving that Sotto can parse its own dotenv export without changing names, values, or entry order.

Changes

  • Add a table-driven dotenv render-and-parse round-trip test.
  • Cover empty input and representative values including whitespace, quotes, backslashes, control characters, literal escape text, $, #, =, and non-ASCII UTF-8.
  • Compare the complete ordered entry vector with the original input.

Testing

  • cargo test -p sotto-cli export::tests
  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

The repository script suite was also attempted during independent review. Eight cargo-audit fixture tests could not generate temporary lockfiles from the offline dependency cache; this contribution changes neither manifests nor Cargo.lock.

Related Issue

Closes #187

Signed-off-by: Akimbo92i <249540823+Akimbo92i@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Thanks for your first pull request to Sotto, and welcome.

Two things that trip up newcomers:

  • Every commit needs a Signed-off-by line under the Developer Certificate of Origin - PRs with unsigned commits cannot be merged. Sign off with git commit -s; if your branch already has unsigned commits, run git rebase --signoff main and push again.
  • Please run cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings before pushing, and add tests for new behaviour (cargo test --workspace runs the suite).

The full guide is in CONTRIBUTING.md - a maintainer will review shortly.

@Akimbo92i
Akimbo92i marked this pull request as ready for review September 9, 2026 23:55

@Maxerns Maxerns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Akimbo92i this matches the issue exactly: all the required cases are there, real control characters are correctly distinct from their literal spellings, and the full vector assertion is the right check. Test only scope, signed off, and thanks for flagging the unrelated audit fixture noise in your environment.

One follow up on that: the audit suite is green on CI and locally here, so it looks environment-specific could you paste the error output? If it shows a real portability gap I'll file it as a separate issue.

Approving CI now; once it's green I'll merge.

@Maxerns
Maxerns merged commit e3524e1 into getsotto:main Sep 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI tests: verify dotenv export and import preserve values end to end

2 participants