Merge: tests: Test result update for `curl_http`
[nit.git] / tests / test_create_more.nit
index 1b0fd1c..e5a1ff1 100644 (file)
 # limitations under the License.
 
 class A
-       attr _attribute: A
-       attr _num: Char
+       var attribute: nullable A is noinit
+       var num: Char is noinit
 
-       meth foo=(a: A)
+       fun foo=(a: nullable A)
        do
                _attribute = a
        end
 
-       meth foo: A
+       fun foo: nullable A
        do
                return _attribute
        end
 
-       meth bar=(c: Char, a: A)   
+       fun bar=(c: Char, a: nullable A)   
        do
                _num = c
                _attribute = a
        end
 
-       meth bar(c: Char): A
+       fun bar(c: Char): nullable A
        do
                if c == _num then
                        return _attribute
@@ -43,13 +43,13 @@ class A
                end
        end
 
-       redef meth to_s: String
+       redef fun to_s: String
        do
                var s = _num.to_s
                if _attribute == null then
-                       s.add('\n')
+                       s += "\n"
                else
-                       s.append(_attribute.to_s)
+                       s += _attribute.to_s
                end
                return s
        end
@@ -61,7 +61,7 @@ class A
                _num = '*'
        end
 
-       init init2(c: Char, a: A)
+       init init2(c: Char, a: nullable A)
        do
                _num = c
                _attribute = a
@@ -81,4 +81,4 @@ a[3] = new A.init2('3', a[2].bar('1'))
 a[2].bar('2') = new A
 a[4] = new A.init2('4', a[2].bar('1'))
 a[5] = new A.init2('5', a[2].bar('2'))
-printn(a)
+print a