idn 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +10 -0
- data/README +2 -2
- data/Rakefile +1 -1
- data/ext/stringprep.c +1 -2
- data/test/tc_Idna.rb +5 -7
- data/test/tc_Stringprep.rb +18 -3
- metadata +2 -2
data/CHANGES
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
Changes with IDN 0.0.2 (2006-02-11)
|
2
|
+
|
3
|
+
* Remove excessive xfree() if a call to stringprep_profile() returns an
|
4
|
+
error. Fixes crash reported in PR #3088.
|
5
|
+
|
6
|
+
* Add tests for invalid Stringprep strings and adjust names of already
|
7
|
+
existing test methods.
|
8
|
+
|
9
|
+
* Improve existing tests for IDN::Idna.
|
10
|
+
|
1
11
|
Changes with IDN 0.0.1 (2005-09-26)
|
2
12
|
|
3
13
|
* First release.
|
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
== LibIDN Ruby Bindings
|
2
2
|
|
3
|
-
Version 0.0.
|
3
|
+
Version 0.0.2
|
4
4
|
|
5
5
|
Ruby Bindings for the GNU LibIDN library, an implementation of the
|
6
6
|
Stringprep, Punycode and IDNA specifications defined by the IETF
|
@@ -168,7 +168,7 @@ mailing list.
|
|
168
168
|
|
169
169
|
=== Copyright & License
|
170
170
|
|
171
|
-
Copyright (c) 2005 Erik Abele. All rights reserved.
|
171
|
+
Copyright (c) 2005-2006 Erik Abele. All rights reserved.
|
172
172
|
|
173
173
|
This documentation and the software itself are licensed under the Apache
|
174
174
|
License, Version 2.0 (the "License").
|
data/Rakefile
CHANGED
data/ext/stringprep.c
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2005 Erik Abele. All rights reserved.
|
2
|
+
* Copyright (c) 2005-2006 Erik Abele. All rights reserved.
|
3
3
|
* Portions Copyright (c) 2005 Yuki Mitsui. All rights reserved.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -67,7 +67,6 @@ static VALUE stringprep_internal(VALUE str, const char *profile)
|
|
67
67
|
rc = stringprep_profile(RSTRING(str)->ptr, &buf, profile, 0);
|
68
68
|
|
69
69
|
if (rc != STRINGPREP_OK) {
|
70
|
-
xfree(buf);
|
71
70
|
rb_raise(eStringprepError, "%s (%d)", stringprep_strerror(rc), rc);
|
72
71
|
return Qnil;
|
73
72
|
}
|
data/test/tc_Idna.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Unit tests for IDN::Idna.
|
2
2
|
#
|
3
|
-
# Copyright (c) 2005 Erik Abele. All rights reserved.
|
3
|
+
# Copyright (c) 2005-2006 Erik Abele. All rights reserved.
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -208,9 +208,8 @@ class Test_Idna < Test::Unit::TestCase
|
|
208
208
|
|
209
209
|
def test_toASCII_UNASSIGNED_ALLOWED
|
210
210
|
TESTCASES_UNASSIGNED.each do |key, val|
|
211
|
-
|
212
|
-
|
213
|
-
end
|
211
|
+
rc = Idna.toASCII(val[0], IDN::Idna::ALLOW_UNASSIGNED)
|
212
|
+
assert_equal(val[1], rc, "TestCase #{key} failed")
|
214
213
|
end
|
215
214
|
end
|
216
215
|
|
@@ -232,9 +231,8 @@ class Test_Idna < Test::Unit::TestCase
|
|
232
231
|
|
233
232
|
def test_toASCII_STD3_NOT_USED
|
234
233
|
TESTCASES_STD3.each do |key, val|
|
235
|
-
|
236
|
-
|
237
|
-
end
|
234
|
+
rc = Idna.toASCII(val[0])
|
235
|
+
assert_equal(val[1], rc, "TestCase #{key} failed")
|
238
236
|
end
|
239
237
|
end
|
240
238
|
|
data/test/tc_Stringprep.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Unit tests for IDN::Stringprep.
|
2
2
|
#
|
3
|
-
# Copyright (c) 2005 Erik Abele. All rights reserved.
|
3
|
+
# Copyright (c) 2005-2006 Erik Abele. All rights reserved.
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -36,6 +36,13 @@ class Test_Stringprep < Test::Unit::TestCase
|
|
36
36
|
'E' => [ "SASLprep", "Example\xC2\xA0Name", "Example Name" ]
|
37
37
|
}
|
38
38
|
|
39
|
+
# STRINGPREP_INVALID test vectors: invalid input strings and their
|
40
|
+
# corresponding profile.
|
41
|
+
|
42
|
+
TESTCASES_STRINGPREP_INVALID = {
|
43
|
+
'A' => [ "Nodeprep", "toto@a/a" ]
|
44
|
+
}
|
45
|
+
|
39
46
|
# NFKC test vectors: UTF-8 encoded strings and the corresponding
|
40
47
|
# normalized form, according to NFKC normalization mode.
|
41
48
|
|
@@ -50,14 +57,22 @@ class Test_Stringprep < Test::Unit::TestCase
|
|
50
57
|
def teardown
|
51
58
|
end
|
52
59
|
|
53
|
-
def
|
60
|
+
def test_with_profile_STRINGPREP
|
54
61
|
TESTCASES_STRINGPREP.each do |key, val|
|
55
62
|
rc = Stringprep.with_profile(val[1], val[0])
|
56
63
|
assert_equal(val[2], rc, "TestCase #{key} failed")
|
57
64
|
end
|
58
65
|
end
|
59
66
|
|
60
|
-
def
|
67
|
+
def test_with_profile_STRINGPREP_INVALID
|
68
|
+
TESTCASES_STRINGPREP_INVALID.each do |key, val|
|
69
|
+
assert_raise(Stringprep::StringprepError, "TestCase #{key} failed") do
|
70
|
+
Stringprep.with_profile(val[0], val[1])
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_nfkc_normalize_NFKC
|
61
76
|
TESTCASES_NFKC.each do |key, val|
|
62
77
|
rc = Stringprep.nfkc_normalize(val[0])
|
63
78
|
assert_equal(val[1], rc, "TestCase #{key} failed")
|
metadata
CHANGED