Commit graph

16 commits

Author SHA1 Message Date
6a43cf4aaf
Rename and update tests for UNIX-specific functionality
Renamed `msg_nowin_test.go` to `msg_unix_test.go` to better reflect its purpose. Updated the file attachment test to use `/dev/mem` for Unix environments instead of a temporary file with restricted permissions, ensuring compatibility with continuous integration environments.
2024-10-27 20:46:16 +01:00
8fb05a33ff
Update tempfile path in unit tests
Changed tempfile creation path to "testdata/tmp" for better test organization and to ensure temporary files are stored within the testdata directory. This change affects the TestMsg_AttachFile_unixOnly tests.
2024-10-27 18:02:37 +01:00
eed3dec7d6
Clean up redundant error checks in msg_nowin_test.go
Removed unnecessary assertions for specific error types in test cases. This streamlines the tests, maintaining focus on the primary failure conditions without checking the error type.
2024-10-27 16:19:16 +01:00
3be41b1aea
Fix chmod notation to use octal literal syntax
Updated the chmod call in msg_nowin_test.go to use the consistent and proper octal literal syntax (0o000) instead of 0000. This change improves code readability and aligns with Go convention.
2024-10-27 16:10:46 +01:00
f7cfe5289a
Remove obsolete tests and add error handling test
Removed commented-out tests to clean up the codebase. Added a new test to verify behavior when the file is closed early during attachment, ensuring robustness.
2024-10-27 16:08:50 +01:00
946ad294ce
Add tests for Msg attachment handling
Introduce new unit tests for verifying the `AttachReader` method and enhancing error handling in attachment functions. These tests cover scenarios for success, file permissions, and early file closure errors.
2024-10-27 15:54:39 +01:00
4b8bf0507d
Update CI workflow and sendmail test condition
Add the TEST_SENDMAIL environment variable for better control over sendmail tests. Optimize sendmail installation in CI by updating and installing ssmtp. Modify tests to check if TEST_SENDMAIL is set to "true" before running.
2024-10-26 16:25:42 +02:00
0b9a215e7d
Add deferred TMPDIR restoration in test setup
Store and restore the original TMPDIR value using a deferred function in `msg_nowin_test.go`. This ensures the TMPDIR environment variable is restored after the test runs, preventing potential side effects on other tests or processes.
2024-09-20 21:42:10 +02:00
af9915e4e7
Add test for WriteToTempFile failure scenario
This new test verifies error handling for WriteToTempFile when the TMPDIR environment variable is set to an invalid directory. It ensures that the method fails as expected under these conditions, improving code robustness.
2024-09-20 19:45:49 +02:00
3922d3f195
Switched copyright header from me to "The go-mail Authors" 2023-01-15 16:14:19 +01:00
64dde76a58
#98 Set up FreeBSD tests via CirrusCI
Cirrus seems to kill the sendmail test, let's make it skip-able
2023-01-12 01:19:24 +01:00
6d22a34548
#42: Add test for Msg.WriteToSendmail 2022-09-08 15:08:17 +02:00
31001e87b2
#24: Add SPDX license IDs for REUSE compliance
# SUMMARY

* Bad licenses:
* Deprecated licenses:
* Licenses without file extension:
* Missing licenses:
* Unused licenses:
* Used licenses: CC0-1.0, MIT
* Read errors: 0
* Files with copyright information: 45 / 45
* Files with license information: 45 / 45

Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-)
2022-06-17 15:05:54 +02:00
8f9fc61c1e
MacOS tests on GH seem to have issued with the sendmail as well. Let's try timeouts 2022-03-18 23:23:59 +01:00
24b99cf0af
Windows has no sendmail, so let's exclude those tests for Windows 2022-03-18 23:13:22 +01:00
7b5b4fa52b
Windows has no sendmail, so let's exclude those tests for Windows 2022-03-18 23:10:53 +01:00