Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/FsSpreadsheet.Js/Cell.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ module JsCell =
dt
| String ->
fsCell.Value |> Some
| anyElse ->
//let msg = sprintf "ValueType '%A' is not fully implemented in FsSpreadsheet and is handled as string input." anyElse
//#if FABLE_COMPILER_JAVASCRIPT
//log msg
//#else
//printfn "%s" msg
//#endif
| Empty ->
fsCell.Value |> box |> Some

/// <summary>
Expand Down
10 changes: 9 additions & 1 deletion src/FsSpreadsheet.Net/Cell.fs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ module Cell =
/// </summary>
let getCellValue (cell : Cell) = cell.CellValue

let tryGetInnerText (cell : Cell) =
if cell.HasChildren then
Some cell.InnerText
else
None

/// <summary>
/// Maps a Cell to the value string using a shared string table.
/// </summary>
Expand All @@ -253,7 +259,9 @@ module Cell =
>> int
>> fun i -> sharedStringTable.[i]
)

| Some CellValues.InlineString ->
cell
|> tryGetInnerText
| _ ->
cell
|> tryGetCellValue
Expand Down
7 changes: 2 additions & 5 deletions src/FsSpreadsheet.Py/Cell.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ module PyCell =
|> Some
| String ->
fsCell.Value |> Some
| anyElse ->
let msg = sprintf "ValueType '%A' is not fully implemented in FsSpreadsheet and is handled as string input." anyElse
printfn "%s" msg

fsCell.Value |> box |> Some
| Empty ->
fsCell.Value |> box |> Some

let toFsCell worksheetName rowIndex columnIndex (pyCell: Cell) =
//printfn "toFsCell worksheetName: %s, rowIndex: %i, columnIndex: %i, %A" worksheetName rowIndex columnIndex (pyCell.value, pyCell.cellType)
Expand Down
4 changes: 4 additions & 0 deletions tests/FsSpreadsheet.Js.Tests/DefaultIO.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ let private tests_Read = testList "Read" [
let! wb = readFromTestFile DefaultTestObject.TestFiles.Libre |> Async.AwaitPromise
Expect.isDefaultTestObject wb
}
testCaseAsync "Pandas" <| async {
let! wb = readFromTestFile DefaultTestObject.TestFiles.Pandas |> Async.AwaitPromise
Expect.isDefaultTestObject wb
}
testCaseAsync "FableExceljs" <| async {
let! wb = readFromTestFile DefaultTestObject.TestFiles.FableExceljs |> Async.AwaitPromise
Expect.isDefaultTestObject wb
Expand Down
3 changes: 3 additions & 0 deletions tests/FsSpreadsheet.Net.Tests/DefaultIO.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ let tests_Read = testList "Read" [
testCase "Libre" <| fun _ ->
let wb = readFromTestFile DefaultTestObject.TestFiles.Libre
Expect.isDefaultTestObject wb
testCase "Pandas" <| fun _ ->
let wb = readFromTestFile DefaultTestObject.TestFiles.Pandas
Expect.isDefaultTestObject wb
testCase "FableExceljs" <| fun _ ->
let wb = readFromTestFile DefaultTestObject.TestFiles.FableExceljs
Expect.isDefaultTestObject wb
Expand Down
4 changes: 4 additions & 0 deletions tests/FsSpreadsheet.Py.Tests/DefaultIO.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ let private tests_Read = testList "Read" [
let wb = readFromTestFile DefaultTestObject.TestFiles.Libre
Expect.isDefaultTestObject wb

testCase "Pandas" <| fun _ ->
let wb = readFromTestFile DefaultTestObject.TestFiles.Pandas
Expect.isDefaultTestObject wb

testCase "FableExceljs" <| fun _ ->
let wb = readFromTestFile DefaultTestObject.TestFiles.FableExceljs
Expect.isDefaultTestObject wb
Expand Down
2 changes: 2 additions & 0 deletions tests/TestUtils/DefaultTestObjects.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let [<Literal>] testFolder = "TestFiles"
type TestFiles =
| Excel
| Libre
| Pandas
| FableExceljs
| ClosedXML
| FsSpreadsheetNET
Expand All @@ -21,6 +22,7 @@ type TestFiles =
match this with
| Excel -> "TestWorkbook_Excel.xlsx"
| Libre -> "TestWorkbook_Libre.xlsx"
| Pandas -> "TestWorkbook_Pandas.xlsx"
| FableExceljs -> "TestWorkbook_FableExceljs.xlsx"
| ClosedXML -> "TestWorkbook_ClosedXML.xlsx"
| FsSpreadsheetNET -> "TestWorkbook_FsSpreadsheet.net.xlsx"
Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/TestUtils/TestUtils.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<EmbeddedResource Include="TestFiles\TestWorkbook_Libre.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="TestFiles\TestWorkbook_Pandas.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="TestFiles\TestWorkbook_FsSpreadsheet.net.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
Expand Down
Loading