library(testthat) describe("Length()",{ it("can show valid conversions", { expect_output(Length("mm", "cm", 100), "100 mm = 10 cm") expect_output(Length("cm", "m", 200), "200 cm = 2 m") expect_output(Length("cm", "mm", 5), "5 cm = 50 mm") expect_output(Length("m", "cm", 3), "3 m = 0.03 cm") expect_output(Length("mm", "m", 1000), "1000 mm = 1 m") expect_output(Length("m", "mm", 1.5), "1.5 m = 1500 mm") }) it("can handle edge cases", { # zero inputs expect_output(Length("mm", "cm", 0), "0 mm = 0 cm") expect_output(Length("m", "cm", 0), "0 m = 0 cm") # large input values expect_output(Length("mm", "m", 1000000), "1000 m") }) })