Skip to content

Commit 81ce407

Browse files
authored
Merge branch 'exercism:main' into phone-number-install-packages-el-fix
2 parents 8e6e2e3 + b049818 commit 81ce407

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

exercises/practice/list-ops/.docs/instructions.append.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Emacs Lisp Track specific functions
1+
## Emacs Lisp track specific functions
22

33
* `list-empty-p` (*given a list, return if the list is empty*)
44
* `list-sum` (*given a list of numbers, return the sum of all elements*)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Instructions Append
2+
3+
In addition to the function, _numbers_, that cleans up phone numbers, you need to write two more functions, _area-code_ and _pprint_ in the Emacs Lisp track.
4+
5+
Each of the extra functions takes the phone number as its only parameter.
6+
7+
The first function _area-code_ extracts the area code from the input, while the second function _pprint_ transforms the input to a string in the format of
8+
```
9+
(NXX) NXX-XXXX
10+
```
11+
where `N` and `X` are as described above.

exercises/practice/phone-number/.docs/instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
Clean up user-entered phone numbers so that they can be sent SMS messages.
3+
Clean up phone numbers so that they can be sent SMS messages.
44

55
The **North American Numbering Plan (NANP)** is a telephone numbering system used by many countries in North America like the United States, Canada or Bermuda.
66
All NANP-countries share the same international country code: `1`.

exercises/practice/phone-number/phone-number-test.el

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
(declare-function pprint "phone-number.el" (num))
1111

1212
(ert-deftest cleans-number-test ()
13-
(should (equal (numbers "(123) 456-7890") "1234567890")))
13+
(should (equal (numbers "(223) 456-7890") "2234567890")))
1414

1515

1616
(ert-deftest cleans-numbers-with-dots-test ()
17-
(should (equal (numbers "123.456.7890") "1234567890")))
17+
(should (equal (numbers "223.456.7890") "2234567890")))
1818

1919

2020
(ert-deftest valid-when-11-digits-and-first-is-1-test ()
21-
(should (equal (numbers "11234567890") "1234567890")))
21+
(should (equal (numbers "12234567890") "2234567890")))
2222

2323

2424
(ert-deftest invalid-when-11-digits-test ()
@@ -40,15 +40,15 @@
4040

4141

4242
(ert-deftest area-code-test ()
43-
(should (equal (area-code "1234567890") "123")))
43+
(should (equal (area-code "2234567890") "223")))
4444

4545

4646
(ert-deftest pprint-test ()
47-
(should (equal (pprint "1234567890") "(123) 456-7890")))
47+
(should (equal (pprint "2234567890") "(223) 456-7890")))
4848

4949

5050
(ert-deftest pprint-full-us-phone-number-test ()
51-
(should (equal (pprint "11234567890") "(123) 456-7890")))
51+
(should (equal (pprint "12234567890") "(223) 456-7890")))
5252

5353

5454
(provide 'phone-number)

0 commit comments

Comments
 (0)