orm_test: remove pg import for now
parent
22348f2245
commit
f9fb6f0be4
|
@ -56,7 +56,7 @@ fn test_ge() {
|
||||||
assert b>=(a)
|
assert b>=(a)
|
||||||
assert c>=(b)
|
assert c>=(b)
|
||||||
assert d>=(c)
|
assert d>=(c)
|
||||||
assert !(c>=d)
|
assert !(c>=d)
|
||||||
assert e>=(a)
|
assert e>=(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,11 +108,11 @@ fn test_split() {
|
||||||
assert vals[2]== 'blue'
|
assert vals[2]== 'blue'
|
||||||
// /////////
|
// /////////
|
||||||
s = 'lalala'
|
s = 'lalala'
|
||||||
vals = s.split('a')
|
vals = s.split('a')
|
||||||
assert vals.len == 3
|
assert vals.len == 3
|
||||||
assert vals[0] == 'l'
|
assert vals[0] == 'l'
|
||||||
assert vals[1] == 'l'
|
assert vals[1] == 'l'
|
||||||
assert vals[2] == 'l'
|
assert vals[2] == 'l'
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_trim_space() {
|
fn test_trim_space() {
|
||||||
|
@ -137,7 +137,7 @@ fn test_join() {
|
||||||
assert s == 'a b c'
|
assert s == 'a b c'
|
||||||
strings = ['one
|
strings = ['one
|
||||||
two ',
|
two ',
|
||||||
'three!
|
'three!
|
||||||
four!']
|
four!']
|
||||||
s = strings.join(' ')
|
s = strings.join(' ')
|
||||||
assert s.contains('one') && s.contains('two ') && s.contains('four')
|
assert s.contains('one') && s.contains('two ') && s.contains('four')
|
||||||
|
@ -316,35 +316,35 @@ fn test_reverse() {
|
||||||
|
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
bar int
|
bar int
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (f Foo) baz() string {
|
fn (f Foo) baz() string {
|
||||||
return 'baz'
|
return 'baz'
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_interpolation() {
|
fn test_interpolation() {
|
||||||
num := 7
|
num := 7
|
||||||
mut s := 'number=$num'
|
mut s := 'number=$num'
|
||||||
assert s == 'number=7'
|
assert s == 'number=7'
|
||||||
foo := Foo{}
|
foo := Foo{}
|
||||||
s = 'baz=${foo.baz()}'
|
s = 'baz=${foo.baz()}'
|
||||||
assert s == 'baz=baz'
|
assert s == 'baz=baz'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_bytes_to_string() {
|
fn test_bytes_to_string() {
|
||||||
mut buf := calloc(10)
|
mut buf := calloc(10)
|
||||||
buf[0] = `h`
|
buf[0] = `h`
|
||||||
buf[1] = `e`
|
buf[1] = `e`
|
||||||
buf[2] = `l`
|
buf[2] = `l`
|
||||||
buf[3] = `l`
|
buf[3] = `l`
|
||||||
buf[4] = `o`
|
buf[4] = `o`
|
||||||
assert string(buf) == 'hello'
|
assert string(buf) == 'hello'
|
||||||
assert string(buf, 2) == 'he'
|
assert string(buf, 2) == 'he'
|
||||||
bytes := [`h`, `e`, `l`, `l`, `o`]
|
bytes := [`h`, `e`, `l`, `l`, `o`]
|
||||||
assert string(bytes, 5) == 'hello'
|
assert string(bytes, 5) == 'hello'
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_count() {
|
fn test_count() {
|
||||||
assert ''.count('') == 0
|
assert ''.count('') == 0
|
||||||
|
|
|
@ -241,7 +241,7 @@ pub fn new_context(cfg gg.Cfg) *Context {
|
||||||
// A dirty hack to implement rendering of cyrillic letters.
|
// A dirty hack to implement rendering of cyrillic letters.
|
||||||
// All UTF-8 must be supported.
|
// All UTF-8 must be supported.
|
||||||
fn (ctx mut Context) init_utf8_runes() {
|
fn (ctx mut Context) init_utf8_runes() {
|
||||||
s := '≈йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ'
|
s := '≈≠⩽⩾йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ'
|
||||||
println(s)
|
println(s)
|
||||||
us := s.ustring()
|
us := s.ustring()
|
||||||
for i := 0; i < us.len; i++ {
|
for i := 0; i < us.len; i++ {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import pg
|
//import pg
|
||||||
|
|
||||||
struct Modules {
|
struct Modules {
|
||||||
id int
|
id int
|
||||||
|
|
Loading…
Reference in New Issue