Comments (17)
Let me deal with #18 first because I think this could make urldecode superfluous. Not sure yet, but will report back
from adar.
crazy things (CRAN won't like them)
ada_url_parse("https://**移动.**")
ada_url_parse("https://www.google.co.jp/search?q=ドイツ")
from adar.
Thank god skip_on_cran()
exists
from adar.
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):
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.
I can help with converting the current tests to that form.
from adar.
@chainsawriot Sure happy if you can do that
\Edit: wait, you already did that, didnt you?
from adar.
Yes. #10 But I am in the test department, so I can add more tests.
from adar.
can't self assigned, but consider this as self assigned.
from adar.
- Improve header hygiene
- Corner cases
from adar.
-
covignore
src/ada
from adar.
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.
@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.
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
ada_has_credentials
can't vectorize; this line looks wrong.
https://github.com/schochastics/adaR/blob/625ef066b13cd360e39c3c178a4f84e7657b96c6/R/has.R#L9
- If
has_*
functions are vectorized, should they not raise errors with invalid URLs, e.g. giveNA_logical_
?
I will fix 1; let me know your thought on 2. Thank you very much!
from adar.
@chainsawriot yes they should probably give NA_logical_
. You wanna do that?
from adar.
@chainsawriot yes they should probably give
NA_logical_
. You wanna do that?
Yeah.
from adar.
- [ ] Standard Mozilla psl tests
The Mozilla test suite is not like what we are doing.
from adar.
- psl corners
from adar.
Related Issues (20)
- Update readme
- Improve `has_*` vectorization HOT 1
- Improve doc HOT 1
- Improve `get_*` vectorization
- `has_*` is not NULL aware HOT 1
- rename url_decode
- parsing fails when protocol is missing HOT 6
- add ada_get_domain HOT 8
- public_suffic fails with wildcard only url HOT 3
- `url_decode2` is not NA aware HOT 5
- Further C++ improvement HOT 4
- Release adaR 0.2.0 HOT 3
- ada_get_domain() doesnt work if path present
- public_suffix() doesnt work with paths HOT 3
- Feature Request: `ada_get_basename` HOT 2
- export clear functions HOT 6
- bump ada-url version HOT 1
- Release adaR 0.3.0
- Support non ICANN suffixes
- Forced encoding change in `ada_set_*()` functions HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adar.