Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
olc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Byers
olc
Commits
ca1d3aa1
Commit
ca1d3aa1
authored
4 years ago
by
David Byers
Browse files
Options
Downloads
Patches
Plain Diff
Packaging cleanup
parent
534c08bd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG
+7
-0
7 additions, 0 deletions
CHANGELOG
olc.el
+4
-6
4 additions, 6 deletions
olc.el
test/olctest.el
+4
-4
4 additions, 4 deletions
test/olctest.el
with
15 additions
and
10 deletions
CHANGELOG
+
7
−
0
View file @
ca1d3aa1
2020-07-22 David Byers <david.byers@liu.se>
2020-07-22 David Byers <david.byers@liu.se>
Fix test cases:
* test/olctest.el: Use keyword args in test cases.
Clean up for melpa:
* olc.el: Use #' instead of ' in a few places. Enable lexical
binding.
Rename some functions:
Rename some functions:
* olc.el (olc-shorten-compound): Renamed from olc-shorten-geo to
* olc.el (olc-shorten-compound): Renamed from olc-shorten-geo to
better match Google's terminology in their plus codes api.
better match Google's terminology in their plus codes api.
...
...
This diff is collapsed.
Click to expand it.
olc.el
+
4
−
6
View file @
ca1d3aa1
;; -*-coding: utf-8;-*-
;;; olc.el --- Open location code library -*-lexical-binding: t;-*-
;;; olc.el --- Open location code library
;; Copyright (C) 2020 David Byers
;; Copyright (C) 2020 David Byers
;;
;;
...
@@ -350,7 +348,7 @@ values cannot (legally) be encoded to the selected length."
...
@@ -350,7 +348,7 @@ values cannot (legally) be encoded to the selected length."
(
nconc
(
make-list
(
max
0
(
-
8
len
))
?0
)
(
nconc
(
make-list
(
max
0
(
-
8
len
))
?0
)
(
when
truncate
(
list
?+
)))))
(
when
truncate
(
list
?+
)))))
(
apply
'string
code
)))
(
apply
#
'
string
code
)))
(
defun
olc-decode
(
code
)
(
defun
olc-decode
(
code
)
...
@@ -476,7 +474,7 @@ faster.
...
@@ -476,7 +474,7 @@ faster.
(
lon
.
,
(
olc-area-lon
area
))
(
lon
.
,
(
olc-area-lon
area
))
(
zoom
.
,
zoom
)
(
zoom
.
,
zoom
)
(
format
.
"json"
))
(
format
.
"json"
))
:parser
'json-read
:parser
#
'
json-read
:sync
t
)))
:sync
t
)))
(
tmp-code
(
tmp-code
(
when
resp
(
when
resp
...
@@ -576,7 +574,7 @@ full open location code."
...
@@ -576,7 +574,7 @@ full open location code."
:params
`
((
q
.
,
reference
)
:params
`
((
q
.
,
reference
)
(
format
.
"json"
)
(
format
.
"json"
)
(
limit
.
1
))
(
limit
.
1
))
:parser
'json-read
:parser
#
'
json-read
:sync
t
)))
:sync
t
)))
(
when
(
eq
200
(
request-response-status-code
resp
))
(
when
(
eq
200
(
request-response-status-code
resp
))
(
let
((
data
(
elt
(
request-response-data
resp
)
0
)))
(
let
((
data
(
elt
(
request-response-data
resp
)
0
)))
...
...
This diff is collapsed.
Click to expand it.
test/olctest.el
+
4
−
4
View file @
ca1d3aa1
;;;; -*-coding: utf-8;-*-
;;;; -*-coding: utf-8;
lexical-binding: t;
-*-
;;;;
;;;;
;;;; Copyright (C) 2020 David Byers
;;;; Copyright (C) 2020 David Byers
;;;;
;;;;
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
(
olctest-run-csv
(
"encoding.csv"
case
)
(
olctest-run-csv
(
"encoding.csv"
case
)
(
let
((
code
(
olc-encode
(
alist-get
'latitude
case
)
(
let
((
code
(
olc-encode
(
alist-get
'latitude
case
)
(
alist-get
'longitude
case
)
(
alist-get
'longitude
case
)
(
alist-get
'length
case
))))
:len
(
alist-get
'length
case
))))
(
unless
(
string=
code
(
alist-get
'expected
case
))
(
unless
(
string=
code
(
alist-get
'expected
case
))
(
olctest-record-failure
case
(
alist-get
'expected
case
)
code
)))))
(
olctest-record-failure
case
(
alist-get
'expected
case
)
code
)))))
...
@@ -190,14 +190,14 @@
...
@@ -190,14 +190,14 @@
(
lon
(
alist-get
'lon
case
))
(
lon
(
alist-get
'lon
case
))
(
len
(
alist-get
'len
case
))
(
len
(
alist-get
'len
case
))
(
shortcode
(
alist-get
'exp
case
))
(
shortcode
(
alist-get
'exp
case
))
(
actual
(
olc-shorten
fullcode
lat
lon
len
)))
(
actual
(
olc-shorten
fullcode
lat
lon
:limit
len
)))
(
unless
(
string=
actual
shortcode
)
(
unless
(
string=
actual
shortcode
)
(
olctest-record-failure
case
shortcode
actual
)))))
(
olctest-record-failure
case
shortcode
actual
)))))
(
defun
olctest-run-all
()
(
defun
olctest-run-all
()
"Run all tests."
"Run all tests."
(
and
(
olctest-decode
)
q
(
and
(
olctest-decode
)
(
olctest-encode
)
(
olctest-encode
)
(
olctest-shortcodes
)
(
olctest-shortcodes
)
(
olctest-validity
)
(
olctest-validity
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment