{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/testthat/issues/256","labels_url":"https://api.github.com/repos/hadley/testthat/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/hadley/testthat/issues/256/comments","events_url":"https://api.github.com/repos/hadley/testthat/issues/256/events","html_url":"https://github.com/hadley/testthat/issues/256","id":76044439,"number":256,"title":" Error in vapply(srcrefs[has_ref], function(x) ","user":{"login":"vspinu","id":1363467,"avatar_url":"https://avatars.githubusercontent.com/u/1363467?v=3","gravatar_id":"","url":"https://api.github.com/users/vspinu","html_url":"https://github.com/vspinu","followers_url":"https://api.github.com/users/vspinu/followers","following_url":"https://api.github.com/users/vspinu/following{/other_user}","gists_url":"https://api.github.com/users/vspinu/gists{/gist_id}","starred_url":"https://api.github.com/users/vspinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vspinu/subscriptions","organizations_url":"https://api.github.com/users/vspinu/orgs","repos_url":"https://api.github.com/users/vspinu/repos","events_url":"https://api.github.com/users/vspinu/events{/privacy}","received_events_url":"https://api.github.com/users/vspinu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-13T16:25:12Z","updated_at":"2015-05-13T18:03:08Z","closed_at":"2015-05-13T18:03:01Z","body":"`test_package(\"lubridate\")` fails with github versions of `lubridate` and `testthat`. It breakes on [this file](https://github.com/hadley/lubridate/blob/master/tests/testthat/test-stamp.R)\r\n\r\nHere is the traceback:\r\n\r\n```\r\n+ Error in vapply(srcrefs[has_ref], function(x) attr(x, \"srcfile\")$filename,  (from traceback.r#15) : \r\n  values must be length 1,\r\n but FUN(X[[7]]) result is length 0\r\n \r\n---------------------------------- \r\n\r\n21: vapply(srcrefs[has_ref], function(x) attr(x, \"srcfile\")$filename, \r\n        FUN.VALUE = character(1)) at traceback.r#15\r\n20: create_traceback(calls) at expectation.r#30\r\n19: expectation_error(e$message, e$calls) at test-that.r#66\r\n18: value[[3L]](cond)\r\n17: tryCatchOne(expr, names, parentenv, handlers[[1L]])\r\n16: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])\r\n15: doTryCatch(return(expr), name, parentenv, handler)\r\n14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), \r\n        names[nh], parentenv, handlers[[nh]])\r\n13: tryCatchList(expr, classes, parentenv, handlers)\r\n12: tryCatch(withCallingHandlers(eval(code, new_test_environment), \r\n        error = capture_calls, message = function(c) invokeRestart(\"muffleMessage\"), \r\n        warning = function(c) invokeRestart(\"muffleWarning\")), error = function(e) {\r\n        ok <- FALSE\r\n        report <- expectation_error(e$message, e$calls)\r\n        get_reporter()$add_result(report)\r\n    }, skip = function(e) {\r\n        report <- expectation_skipped(e$message)\r\n        get_reporter()$add_result(report)\r\n    }) at test-that.r#57\r\n11: test_code(desc, substitute(code), env = parent.frame()) at test-that.r#30\r\n10: test_that(\"stamp works with ISO-8601 formats\", {\r\n        stamp_Ou <- stamp(\"2013-01-01T06:00:00Z\")\r\n        stamp_Oo <- stamp(\"2013-01-01T00:00:00-06\")\r\n        stamp_Oz <- stamp(\"2013-01-01T00:00:00-0600\")\r\n        stamp_OO <- stamp(\"2013-01-01T00:00:00-06:00\")\r\n        tz <- c(\"America/Chicago\", \"UTC\", \"Europe/Paris\")\r\n        Ou <- c(\"2013-01-01T06:00:00Z\", \"2013-01-01T00:00:00Z\", \"2012-12-31T23:00:00Z\")\r\n        Oo <- c(\"2013-01-01T00:00:00-06\", \"2013-01-01T00:00:00+00\", \r\n            \"2013-01-01T00:00:00+01\")\r\n        Oz <- c(\"2013-01-01T00:00:00-0600\", \"2013-01-01T00:00:00+0000\", \r\n            \"2013-01-01T00:00:00+0100\")\r\n        OO <- c(\"2013-01-01T00:00:00-06:00\", \"2013-01-01T00:00:00+00:00\", \r\n            \"2013-01-01T00:00:00+01:00\")\r\n        for (i in seq_along(tz)) {\r\n            expect_equal(stamp_Ou(ymd(\"2013-01-01\", tz = tz[i])), \r\n                Ou[i])\r\n            expect_equal(stamp_Oo(ymd(\"2013-01-01\", tz = tz[i])), \r\n                Oo[i])\r\n            expect_equal(stamp_Oz(ymd(\"2013-01-01\", tz = tz[i])), \r\n                Oz[i])\r\n            expect_equal(stamp_OO(ymd(\"2013-01-01\", tz = tz[i])), \r\n                OO[i])\r\n        }\r\n        expect_equal(suppressWarnings(stamp_Ou(ymd(\"2013-01-01\", \r\n            tz = \"Asia/Kolkata\"))), \"2012-12-31T18:30:00Z\")\r\n        expect_warning(stamp_Oo(ymd(\"2013-01-01\", tz = \"Asia/Kolkata\")))\r\n        expect_equal(suppressWarnings(stamp_Oo(ymd(\"2013-01-01\", \r\n            tz = \"Asia/Kolkata\"))), \"2013-01-01T00:00:00+0530\")\r\n        expect_equal(stamp_Oz(ymd(\"2013-01-01\", tz = \"Asia/Kolkata\")), \r\n            \"2013-01-01T00:00:00+0530\")\r\n        expect_equal(stamp_OO(ymd(\"2013-01-01\", tz = \"Asia/Kolkata\")), \r\n            \"2013-01-01T00:00:00+05:30\")\r\n        expect_equal(stamp_OO(ymd(c(\"2013-01-01\", \"2010-01-01\"), \r\n            tz = \"Asia/Kolkata\")), c(\"2013-01-01T00:00:00+05:30\", \r\n            \"2010-01-01T00:00:00+05:30\"))\r\n    }) at test-stamp.R#87\r\n9: eval(expr, envir, enclos)\r\n8: eval(exprs, envir) at test-files.r#167\r\n7: sys.source2(fname, new.env(parent = env)) at test-files.r#145\r\n6: FUN(c(\"/home/vspinu/.lib/R/lubridate/tests/testthat/test-accessors.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-am-pm.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-Dates.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-daylight-savings.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-decimal-date.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-difftimes.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-durations.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-guess.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-instants.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-intervals.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-ops-addition.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-ops-division.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-ops-integer-division.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-ops-modulo.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-ops-multiplication.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-ops-subtraction.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-parsers.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-periods.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-POSIXt.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-rollback.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-round.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-settors.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-stamp.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-timespans.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-timezones.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-update.R\", \r\n   \"/home/vspinu/.lib/R/lubridate/tests/testthat/test-utilities.R\"\r\n   )[[23L]], ...)\r\n5: lapply(paths, test_file, env = env, reporter = current_reporter, \r\n       start_end_reporter = FALSE) at test-files.r#38\r\n4: test_dir(test_path, reporter = reporter, env = env, filter = filter, \r\n       ...) at test-package.r#61\r\n3: with_top_env(env, {\r\n       test_dir(test_path, reporter = reporter, env = env, filter = filter, \r\n           ...)\r\n   }) at test-package.r#60\r\n2: run_tests(package, test_path, filter, reporter, ...) at test-package.r#52\r\n1: test_package(\"lubridate\")\r\n```"},"comment":{"url":"https://api.github.com/repos/hadley/testthat/issues/comments/101760854","html_url":"https://github.com/hadley/testthat/issues/256#issuecomment-101760854","issue_url":"https://api.github.com/repos/hadley/testthat/issues/256","id":101760854,"user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T18:03:08Z","updated_at":"2015-05-13T18:03:08Z","body":"Thanks for spotting this!"}}