@@ -1631,6 +1631,36 @@ def test_move_column(table):
1631
1631
table = table .move_column (2 , 1 )
1632
1632
assert table .labels == ('count' , 'points' , 'letter' )
1633
1633
1634
+
1635
+ def test_join_with_empty_self (table2 ):
1636
+ empty_table = Table ().with_columns (['letter' , []])
1637
+ result = empty_table .join ('letter' , table2 )
1638
+ assert result is None , "Expected None when joining with an empty self table"
1639
+
1640
+ def test_join_with_empty_other (table ):
1641
+ empty_table = Table ().with_columns (['points' , []])
1642
+ result = table .join ('points' , empty_table )
1643
+ assert result is None , "Expected None when joining with an empty other table"
1644
+
1645
+ def test_join_with_other_label (table , table2 ):
1646
+ result = table .join ('points' , table2 , 'points' )
1647
+ assert_equal (result , """
1648
+ points | letter | count | names
1649
+ 1 | a | 9 | one
1650
+ 2 | b | 3 | two
1651
+ 2 | c | 3 | two
1652
+ """ )
1653
+
1654
+ def test_join_without_other_label (table , table2 ):
1655
+ result = table .join ('points' , table2 )
1656
+ assert_equal (result , """
1657
+ points | letter | count | names
1658
+ 1 | a | 9 | one
1659
+ 2 | b | 3 | two
1660
+ 2 | c | 3 | two
1661
+ """ )
1662
+
1663
+
1634
1664
##################
1635
1665
# Export/Display #
1636
1666
##################
0 commit comments