Added GoLand directive to suppress deprecation warnings for SetAttachements method in msg_test.go. This method is already fully tested by SetAttachments and the test is marked to be skipped.
Introduced new test cases for ContentType values to ensure proper handling. Additionally, simplified multiple error messages in existing tests to enhance readability and maintain consistency.
Introduce tests for `SetEmbeds` with single, multiple, and no files. Add `UnsetAllEmbeds` and `UnsetAllParts` tests to ensure embeds and attachments are removed correctly.
Introduced tests for embedding files and managing attachments in messages. Validated behavior for setting and unsetting attachments and retrieving embedded files with various scenarios.
Implemented comprehensive tests for SetAttachments including scenarios with single, multiple, and no files. Additionally, deprecated the SetAttachements function and noted it as fully tested by SetAttachments.
Eliminated the TestMsg_SetAttachments function from the test suite as it duplicates functionality covered by other tests. Removing this redundant code improves maintainability and clarity.
Introduced a new test case to check `GetAttachments` when no attachments are present in the message object. Removed the redundant `TestMsg_GetAttachments` function to simplify the test suite.
This commit introduces unit tests for the GetAttachments method in the Msg struct to ensure it correctly handles both single and multiple attachments. The tests verify the name and content of the attachments to validate the expected behavior.
Introduce comprehensive tests for the GetGenHeader and GetParts methods. These tests cover single and multiple values for headers, body parts retrieval, and edge cases such as nil values, ensuring robustness and correctness.
Introduced unit tests for GetFrom, GetFromString, GetTo, GetToString, GetCc, GetCcString, GetBcc, and GetBccString methods. These tests cover scenarios with single, multiple, and no addresses, ensuring correct functionality of email address retrieval methods.
Add unit tests for the GetAddrHeaderString function to verify correct behavior for various header types and address counts. These tests ensure the function correctly handles single and multiple addresses, as well as scenarios with no addresses.
Introduce a new test to validate the behavior of GetAddrHeader for handling multiple addresses (to, cc, bcc). This test ensures that the function correctly processes and returns the expected addresses in various headers.
Introduce unit tests for the GetAddrHeader function in the Msg struct. These tests cover various scenarios, including valid addresses and handling of headers like "from," "to," "cc," and "bcc."
Implemented comprehensive tests for the Msg.GetRecipients method, covering various scenarios such as recipients in "to", "cc", "bcc" fields and combinations of these. Ensured correct handling of each case and validation against expected recipient counts and specific addresses.
Ensured the file ends with a newline to comply with best practices. This change improves code readability and consistency with other files in the repository.
Implemented tests for `RequestMDNToFormat`, `RequestMDNAddTo`, and `RequestMDNAddToFormat` methods to ensure proper address handling. Added comprehensive `GetSender` method tests to verify sender retrieval in various scenarios. This enhances coverage and robustness of email message handling functionality.
Add checks to initialize `genHeader` if it is nil in the RequestMDNTo method to prevent potential nil map assignment errors. The newly implemented tests showed that this method was never actually working and the old test was inefficient to identify this.
Introduce tests for SetImportance, SetOrganization, SetUserAgent, and IsDelivered methods in the Msg type. These additions ensure the correct behavior and robustness of the email handling functionality.
Reformatted the test cases for European umlaut characters for consistency and readability. This change does not affect the execution or output of the tests.
Introduce tests for SetMessageIDWithValue, SetDate, and SetDateWithValue functions. Enhance coverage and validation for these methods by comparing generated headers and parsed dates.
Introduce unit tests to ensure SetMessageID generates unique IDs and GetMessageID correctly formats various input IDs. Additionally, verify GetMessageID returns an empty string when no ID is set.
Added a test case for European umlaut characters in msg_test.go. Removed redundant test cases related to address handlers (To, Cc, Bcc) and other helper methods to streamline the code.
Introduced unit tests to verify the encoding of different character sets in the Msg.Subject() method. Tests include cases for Latin characters, Japanese, Simplified Chinese, Cyrillic, and Emoji to ensure proper encoding handling.
Implement new tests for the Msg.ReplyToFormat method to ensure it correctly handles both valid and invalid email addresses. These tests validate the ReplyTo header formatting and error handling.
Introduce unit tests for the `ReplyTo` method in the `Msg` struct to validate both correct handling of valid email addresses and proper failure responses for invalid ones. Further, refactor and add helper functions to check generated headers in messages.
Introduce comprehensive unit tests for Bcc functionalities, including validation of single and multiple addresses, various invalid input scenarios, and RFC5322 compliance checks. Additionally, implement tests for AddBcc, AddBccFormat, BccIgnoreInvalid, and BccFromString methods to ensure robust handling of different Bcc cases.
This commit introduces comprehensive tests for various "Cc" related methods in the `Msg` struct. It includes test cases for valid and invalid email addresses for methods: `Cc`, `AddCc`, `AddCcFormat`, `CcIgnoreInvalid`, and `CcFromString`, ensuring robust handling of different scenarios and edge cases.
Removed test cases for IPv6 and IPv4 addresses from `msg_test.go` as they are no longer required. Also made a minor formatting adjustment to the `checkAddrHeader` function signature for better readability.
Consolidate repeated header validation logic into the `checkAddrHeader` helper function. This refactoring improves code readability and maintainability by reducing redundancy and potential for errors.
Replace repeated address header validation code with a helper function `checkAddrHeader` to reduce redundancy and improve readability. Also, add new test cases for `ToFromString` to handle valid addresses with and without empty fields.
Introduces new test cases to verify the Msg_ToIgnoreInvalid function handles various scenarios correctly. These tests check for behavior with valid addresses, invalid addresses, and a mix of both.
Introduce a new, empty test function `TestMsg_ToIgnoreInvalid` in `msg_test.go` to accommodate future test cases. This commit also aligns a comment for better readability.
Introduced new test cases to validate Msg.AddToFormat functionality with both valid and invalid email addresses. Ensured proper error handling and address formatting in the message headers.
Corrected incorrect address references in the `msg_test.go` file. Added new tests to validate the AddTo functionality, ensuring multiple addresses can be added and validated properly.
This change adds `//goland:noinspection GoDeprecation` comments in the `msg_test.go` file. These comments suppress deprecation warnings for the `SetHeader` and `SetHeaderPreformatted` methods during test execution.
Refactor "From" related tests to improve error messages and add tests for the new "FromFormat" function. Introduce new tests to validate the "To" address handling, covering various valid and invalid address scenarios.
Implemented extensive test cases for the "From" field in email messages, covering various valid and invalid email formats according to RFC5322. Verified correct handling for each scenario to ensure robustness of email address validation.
Implemented comprehensive tests for the EnvelopeFrom and EnvelopeFromFormat methods to ensure proper handling of valid and invalid email addresses. This includes validation of both address and format for the "EnvelopeFrom" header.
Renamed existing test cases for clarity and added new test cases for SetAddrHeaderIgnoreInvalid function. The new tests cover multiple scenarios including valid/invalid addresses, and edge cases such as nil addrHeader map.
Implemented extensive unit tests for setting various headers and address fields in the `Msg` struct, including setting general headers, preformatted headers, and address headers with various scenarios to ensure correctness and robustness.
This commit introduces two new unit tests: `TestMsg_Charset` and `TestMsg_SetHeader`. These tests cover the functionality of setting and retrieving the character set and headers for messages, ensuring correctness and robustness.
Consolidated repetitive test data into shared variables to improve code maintainability and readability. This modification also helps in reducing redundancy and streamlining future updates to test data.
Reorganized and condensed test cases for the NewMsg method by merging individual tests and removing obsolete functions. This improves maintainability and reduces duplication in the test suite.
Updated the SetMessageID method to generate a "Message-ID" using a
single randomly generated string combined with the hostname, replacing
the prior complex format that included process ID and multiple random
numbers. This change simplifies the code of the generated IDs.
Updated the TestMsg_SetMessageIDRandomness test to run 50,000 iterations instead of 100, ensuring a more robust evaluation of the Msg.SetMessageID method's randomness. Additionally, streamlined the retrieval of Message ID using GetMessageID.