10years ago, make doctest by tim peters.
http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763?pli=1
doctest issue is following.
http://stackoverflow.com/questions/5522334/python-does-unittest-have-something-that-doctest-hasnt
http://stackoverflow.com/questions/5006698/what-is-the-equivalent-of-a-python-docstring-in-ruby
http://blog.jdhardy.ca/2010/10/running-django-test-suite-on-ironpython.html
So, after all, It's a style problem.
Is there a vala style guide?
http://code.google.com/p/soc/wiki/PythonStyleGuide
http://live.gnome.org/Vala/Tutorial#Strings
attempt test file.
It's capable in vala? Thanks for any advise.
struct Field {
string name;
string val;
}
//public void printArray (Field[,] a) { // i don't know how
pass struct args...
// int row = 0;
// int c = 0;
// do {
// for (c = 0; c < 3; c++) {
// print(a[row,c].val);
// }
// row++;
// print("\n");
// } while (row < 3);
//}
class test : GLib.Object {
public static int main(string[] args) {
var __doc__ = """
>>> int row = 0;
>>> int c = 0;
>>> do {
>>> for (c = 0; c < 3; c++) {
>>> print(result[row,c].val); // more
useful if use in string template...
>>> }
>>> row++;
>>> print("\n");
>>> } while (row < 3);
虫虫虫
虫虫虫
虫虫虫
""";
int row = 0, cols = 5;
int c = 0;
Field[,] results = new Field[3,5]; //{};
do {
for (c = 0; c < cols; c++) {
results[row,c] = Field() { name = "test", val =
"虫" };
print(results[row,c].val);
}
row++;
print("\n");
} while (row < 3);
//printArray(results);
return 0;
}
}_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list