`quote(fun(1))` should have 2 arguments (has 1)

[1] "`quote(fun(1))` should have 2 arguments (has 1)"

`quote(fun(1, 2))` should have 1 arguments (has 2)

[1] "`quote(fun(1, 2))` should have 1 arguments (has 2)"

`quote(fun2(1, 2))[[1]]` should be a call to `fun` (is a call to `fun2`)

[1] "`quote(fun2(1, 2))[[1]]` should be a call to `fun` (is a call to `fun2`)"

`quote(fun(1, fun(3)))[[3]][[1]]` should be a call to `fun2` (is a call to `fun`)

[1] "`quote(fun(1, fun(3)))[[3]][[1]]` should be a call to `fun2` (is a call to `fun`)"

`quote(fun2(a, b, c))[[1]]` should be a call to `fun` (is a call to `fun2`)

[1] "`quote(fun2(a, b, c))[[1]]` should be a call to `fun` (is a call to `fun2`)"

alike(quote(fun(a, fun2())), quote(fun(b, fun2(a, b, c))))

# Attributes on sub-components should not affect anything
# actually, these tests need to be with alike since lang_alike doesn't check
# attributes

[1] "`c0` should have attribute \"blah\""

`attr(c0.2, "blah")` should be character (is integer)

[1] "`attr(c0.2, \"blah\")` should be character (is integer)"

`(z ~ w + 1)[[3]]` should be "symbol" (is "language")

`(z ~ w + 1)[[3]][[3]]` should have identical constant values

[1] "`(z ~ w + 1)[[3]][[3]]` should have identical constant values"

`(x ~ y)[[3]]` should be a call to `+` (is "symbol")

[1] "`(x ~ y)[[3]]` should be a call to `+` (is \"symbol\")"

alike(y ~ x^2 + x * z + z + w:z, q ~ l^2 + l * j + j + w:j)

alike(y ~ x^2 + x * z + z + w:z, q ~ l^3 + l * j + j + w:j)

`(q ~ l^3 + l * j + j + w:j)[[3]][[2]][[2]][[2]][[3]]` should have identical constant values

exp.1 <- parse(text = "x + y; fun2(fun(1, 2, 3), z)", keep.source = TRUE)

# # Repeating parses to deal with potential parse issues in clean R runs

exp.2 <- parse(text = "z + 2; fun(fun2(1, 2, 3), q)", keep.source = TRUE)

exp.3 <- parse(text = "z + fun(3); fun(fun2(a, b, c), 3)", keep.source = TRUE)

`exp.2[[1]][[3]]` should be "symbol" (is "double")

`exp.3[[1]][[3]]` should be "double" (is "language")

`exp.2[[1]][[3]]` should be a call to `fun` (is "double")

[1] "`exp.2[[1]][[3]]` should be a call to `fun` (is \"double\")"