feat: Initial csv parsing for uploading rooms for a project. Need to style the upload form.
All checks were successful
CI / Linux Tests (push) Successful in 5m41s
All checks were successful
CI / Linux Tests (push) Successful in 5m41s
This commit is contained in:
22
Tests/CSVParsingTests/CSVParsingTests.swift
Normal file
22
Tests/CSVParsingTests/CSVParsingTests.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
import CSVParser
|
||||
import Foundation
|
||||
import Testing
|
||||
|
||||
@Suite
|
||||
struct CSVParsingTests {
|
||||
|
||||
@Test
|
||||
func roomParsing() async throws {
|
||||
|
||||
let parser = CSVParser.liveValue
|
||||
|
||||
let input = """
|
||||
Name,Heating Load,Cooling Total,Cooling Sensible,Register Count
|
||||
Bed-1,12345,12345,,2
|
||||
Bed-2,1223,,1123,1
|
||||
"""
|
||||
let rooms = try await parser.parseRooms(.init(file: Data(input.utf8)))
|
||||
|
||||
#expect(rooms.count == 2)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user