         XCTAssertNil(csv.currentRow)
     }
 
+    func testHasHeaderRow4() {
+        let csvString = ""
+        do {
+            _ = try CSVReader(string: csvString, hasHeaderRow: true)
+            XCTFail("CSVReader did not throw an error")
+        } catch CSVError.cannotReadHeaderRow {
+            // Success
+        } catch {
+            XCTFail("\(error)")
+        }
+    }
+
     func testSubscript1() {
         let csvString = "key1,key2\nvalue1,value2"
         let csv = try! CSVReader(string: csvString, hasHeaderRow: true)

            i += 1
        }
        XCTAssertEqual(i, 3)
    }

    func testCSVState1() {

        XCTAssertEqual(record, ["zxcv", "asdf", "qw\"er", ""])
    }

    func testDoubleQuoteBeforeLineBreak1() {
        let csv = "\"abc\",1,\"2\"\n\n\"cde\",3,\"4\""
        var i = 0
        for record in AnyIterator(try! CSVReader(string: csv)) {
