Repository: promptfoo/promptfoo
Issue: Bug: When loading assertions from CSV, default test (equals) may be including new line character in expected value
Root cause: Validation Gap

When loading assertions from CSV file, new line character (\n) from the CSV appears to be included in the expected output using the default assertion (equals).

**To Reproduce**

Use this for your .yaml file: 
description: "load tests from csv"
prompts:
  - "Translate the following phrase into spanish and only output the translation - {{phrase}}"
providers:
  - google:gemini-2.0-flash
tests: file://test.csv

Use this for your .csv file:
phrase,__expected
Leave me alone!,¡Déjame en paz!

run promptfoo eval command

**Expected behavior**
Expected to see the test fail with the following message:
Expected output "¡Déjame en paz!
" to equal "¡Déjame en paz!"

**Screenshots**

![Image](https://github.com/user-attachments/assets/57f009f5-ca71-4ad4-b86f-5da86161319f)

**System information:**

{
  "version": "0.105.1",
  "platform": {
    "os": "linux",
    "release": "6.10.11-1rodete2-amd64",
    "arch": "x64",
    "nodeVersion": "v20.18.1"
  },
  "env": {},
  "configInfo": {
    "defaultConfigPath": "/usr/local/home/dominickenny/promptfoo/mar_21/3-21_1/promptfooconfig.yaml",
    "configExists": true,
    "configContent": {
      "config": {
        "tags": {},
        "description": "load tests from csv",
        "prompts": [
          "Translate the following phrase into spanish and only output the translation - {{phrase}}"
        ],
        "providers": [
          "google:gemini-2.0-flash"
        ],
        "tests": [
          {
            "vars": {
              "phrase": "Leave me alone!"
            },
            "assert": [
              {
                "type": "equals",
                "value": "¡Déjame en paz!"
              }
            ],
            "options": {},
            "description": "Row #1"
          }
        ],
        "scenarios": [],
        "env": {},
        "sharing": true,
        "defaultTest": {
          "vars": {},
          "assert": [],
          "options": {},
          "metadata": {}
        },
        "outputPath": [],
        "extensions": [],
        "metadata": {}
      },
      "testSuite": {
        "description": "load tests from csv",
        "tags": {},
        "prompts": [
          {
            "raw": "Translate the following phrase into spanish and only output the translation - {{phrase}}",
            "label": "Translate the following phrase into spanish and only output the translation - {{phrase}}"
          }
        ],
        "providers": [
          {
            "env": {},
            "modelName": "gemini-2.0-flash",
            "config": {
              "basePath": "/usr/local/home/dominickenny/promptfoo/mar_21/3-21_1"
            },
            "label": ""
          }
        ],
        "providerPromptMap": {},
        "tests": [
          {
            "vars": {
              "phrase": "Leave me alone!"
            },
            "assert": [
              {
                "type": "equals",
                "value": "¡Déjame en paz!"
              }
            ],
            "options": {},
            "description": "Row #1"
          }
        ],
        "scenarios": [],
        "defaultTest": {
          "metadata": {},
          "options": {},
          "vars": {},
          "assert": []
        },
        "nunjucksFilters": {},
        "extensions": []
      },
      "basePath": "/usr/local/home/dominickenny/promptfoo/mar_21/3-21_1"
    }
  }
}


- Promptfoo version: 0.105.1


Thanks for the report. #3459 should fix