Code Monkey home page Code Monkey logo

Comments (17)

schochastics avatar schochastics commented on June 8, 2024 1

Let me deal with #18 first because I think this could make urldecode superfluous. Not sure yet, but will report back

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

crazy things (CRAN won't like them)

  • ada_url_parse("https://**移动.**")
  • ada_url_parse("https://www.google.co.jp/search?q=ドイツ")

from adar.

schochastics avatar schochastics commented on June 8, 2024

Thank god skip_on_cran() exists

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

It is slightly more complicated than that. CRAN doesn't allow R scripts with non-ASCII characters (unless with compelling reasons). Therefore, one has to do something like this (which is kind-of okay, if there are only a few tests):

https://github.com/ropensci/readODS/blob/7548c3ab8778efc2d6058fc56ca84920b2e3a92f/tests/testthat/test_xml_fuzz.R#L2

Another way is to group all non-ASCII tests in one file and then .Rbuildignore it. But that would means only the coverage test would test them. Not a good thing.

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

I can help with converting the current tests to that form.

from adar.

schochastics avatar schochastics commented on June 8, 2024

@chainsawriot Sure happy if you can do that

\Edit: wait, you already did that, didnt you?

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

Yes. #10 But I am in the test department, so I can add more tests.

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

can't self assigned, but consider this as self assigned.

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024
  • Improve header hygiene
  • Corner cases

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024
  • covignore src/ada

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

Thanks to utils::URLdecode(), should we fix this? @schochastics

  require(adaR)
#> Loading required package: adaR
  corners <- c(NA, NULL, "", "a", 1)
  testthat::expect_error(x <- ada_url_parse(corners), NA)
  testthat::expect_error(y <- ada_url_parse(corners, decode = FALSE), NA)
  x$host
#> [1] "NA" "NA" "NA" "NA"
  y$host
#> [1] NA NA NA NA

Created on 2023-09-24 with reprex v2.0.2

from adar.

schochastics avatar schochastics commented on June 8, 2024

@chainsawriot I think this needs to be fixed. What I did in #20 doesnt help with URLdecoding afais. You wanna fix it together with the tests?

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

Now it's in a TDD (Test-driven development) mode

urls <- rep("http://www.google.com", 3)
adaR::ada_has_credentials(urls) ## ERROR
#> Error in vapply(url, function(x) vapply(url, function(x) Rcpp_ada_has_credentials(x, : values must be length 1,
#>  but FUN(X[[1]]) result is length 3
adaR::ada_has_empty_hostname(urls)
#> http://www.google.com http://www.google.com http://www.google.com 
#>                 FALSE                 FALSE                 FALSE

urls2 <- c(urls, "abc")
adaR::ada_has_empty_hostname(urls2) ## should this be NA?
#> Error in eval(expr, envir, enclos): input is not a valid url

Created on 2023-09-24 with reprex v2.0.2

@schochastics

  1. ada_has_credentials can't vectorize; this line looks wrong.

https://github.com/schochastics/adaR/blob/625ef066b13cd360e39c3c178a4f84e7657b96c6/R/has.R#L9

  1. If has_* functions are vectorized, should they not raise errors with invalid URLs, e.g. give NA_logical_?

I will fix 1; let me know your thought on 2. Thank you very much!

from adar.

schochastics avatar schochastics commented on June 8, 2024

@chainsawriot yes they should probably give NA_logical_. You wanna do that?

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

@chainsawriot yes they should probably give NA_logical_. You wanna do that?

Yeah.

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024

- [ ] Standard Mozilla psl tests

The Mozilla test suite is not like what we are doing.

from adar.

chainsawriot avatar chainsawriot commented on June 8, 2024
  • psl corners

from adar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.