Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed May 24, 2022
1 parent 53ff881 commit 0f86613
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/Table_Tests/src/Delimited_Read_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,21 @@ spec =
t2.at "c" . to_vector . should_equal [3, 6]
t2.columns.map .name . should_equal ["a", "b", "c"]

Test.specify "should be able to parse raw text" <|
text1 = """
a,b,c
1,2,3
4,5,6
t1 = Table.Table.from text1 (format = File_Format.Delimited ",")
t1.columns.map .name . should_equal ["a", "b", "c"]
t1.at "a" . to_vector . should_equal [1, 4]
t1.at "b" . to_vector . should_equal [2, 5]
t1.at "c" . to_vector . should_equal [3, 6]

text2 = 'a\tb\n1\t2\n3\t4'
t2 = Table.Table.from text2
t2.columns.map .name . should_equal ["a", "b"]
t2.at "a" . to_vector . should_equal [1, 3]
t2.at "b" . to_vector . should_equal [2, 4]

main = Test.Suite.run_main here.spec

0 comments on commit 0f86613

Please sign in to comment.