1test_that('repr_text works with 1D ts object', {
2	expect_identical(repr_text(as.ts(1:4)), 'A Time Series:\n[1] 1 2 3 4')
3})
4
5test_that('repr_markdown works with 2D ts object', {
6	series <- ts(c(
7		10.9817,11.5721,11.9866,11.1937,
8		11.6959,11.3342,10.8519,10.7861
9	), start = c(1984, 03), frequency = 4)
10	expect_identical(repr_markdown(series), '
11A Time Series: 3 \u00D7 4
12
13| <!--/--> | Qtr1 | Qtr2 | Qtr3 | Qtr4 |
14|---|---|---|---|---|
15| 1984 | <!----> | <!----> | 10.9817 | 11.5721 |
16| 1985 | 11.9866 | 11.1937 | 11.6959 | 11.3342 |
17| 1986 | 10.8519 | 10.7861 | <!----> | <!----> |
18
19')
20})
21
22test_that('Displaying a single-row time series works', {
23	series <- ts(1:4, start=c(2000,1), frequency=12)
24	expect_identical(repr_markdown(series), '
25A Time Series: 1 \u00D7 4
26
27| <!--/--> | Jan | Feb | Mar | Apr |
28|---|---|---|---|---|
29| 2000 | 1 | 2 | 3 | 4 |
30
31')
32})
33