File: test-scaling.R

package info (click to toggle)
r-cran-diffobj 0.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,432 kB
  • sloc: ansic: 455; javascript: 96; sh: 32; makefile: 8
file content (57 lines) | stat: -rwxr-xr-x 1,627 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
NAME <- "scaling"
source(file.path('_helper', 'init.R'))

# These tests are not actually run since they require manual intervention to
# check for browser rendering

# These tests should be run on as many browsers as possible as well as in
# RStudio, and consist of running the code and resizing the windows to see
# what happens

if(FALSE) { # prevent running
  # Text should be allowed to unfurl beyond native width

  diffStr(mdl1, mdl2, format="html")
  diffStr(mdl1, mdl2, format="html", style=list(scale=FALSE))

  diffPrint(c(mdl1), c(mdl2), format="html")

  # Revealed problems with pixel rounding in scaling

  diffPrint(letters[1:6], LETTERS[1:6], format="html")
  diffPrint(letters[1:6], LETTERS[1:6], format="html", style=list(scale=FALSE))

  # Revealed problems with gutter width computations; and scaling

  mx.2 <- matrix(1:100, ncol=4)
  mx.4 <- mx.3 <- mx.2
  mx.3[15, 2] <- 111L
  mx.3a <- mx.3[-5, ]
  diffPrint(mx.2, mx.3a, format="html")

  # summary stuff

  summary(diffPrint(letters, LETTERS, format="html"))
  summary(diffStr(mdl1, mdl2, format="html"))
  summary(diffPrint(c(mdl1), c(mdl2), format="html"))

  # Long banners

  diffPrint(
    1:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
    2:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
    format="html", style=list(scale=FALSE)
  )
  diffPrint(
    1:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
    2:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
    format="html"
  )
  # context

  diffPrint(
    1:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
    2:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
    format="html", mode="context"
  )
}