1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt fixes

This commit is contained in:
Alexander Medvednikov
2019-07-16 17:59:07 +02:00
parent 7bbaf432e6
commit c35adbea91
18 changed files with 136 additions and 96 deletions

View File

@@ -299,3 +299,22 @@ fn test_reverse() {
t := ''
assert t.reverse() == t
}
struct Foo {
bar int
}
fn (f Foo) baz() string {
return 'baz'
}
fn test_interpolation() {
num := 7
mut s := 'number=$num'
assert s == 'number=7'
foo := Foo{}
s = 'baz=${foo.baz()}'
assert s == 'baz=baz'
}

View File

@@ -505,4 +505,4 @@ pub fn (c Complex) acsch() Complex {
// Complex Equals
pub fn (c1 Complex) equals(c2 Complex) bool {
return (c1.re == c2.re) && (c1.im == c2.im)
}
}

View File

@@ -771,4 +771,4 @@ fn test_complex_acsch() {
result = c1.acsch()
// Some issue with precision comparison in f64 using == operator hence serializing to string
assert result.str().eq(c2.str())
}
}

View File

@@ -145,4 +145,4 @@ fn block(dig &Digest, p []byte) {
pub fn (d &Digest) size() int { return Size }
pub fn (d &Digest) block_size() int { return BlockSize }
pub fn (d &Digest) block_size() int { return BlockSize }

View File

@@ -150,4 +150,4 @@ fn block(dig &Digest, p []byte) {
pub fn (d &Digest) size() int { return Size }
pub fn (d &Digest) block_size() int { return BlockSize }
pub fn (d &Digest) block_size() int { return BlockSize }

View File

@@ -90,4 +90,4 @@ pub fn big_endian_put_u64(b []byte, v u64) {
b[5] = byte(v >> u64(16))
b[6] = byte(v >> u64(8))
b[7] = byte(v)
}
}

View File

@@ -7,4 +7,4 @@ fn test_hash_crc32() {
c := crc32.new(crc32.IEEE)
assert c.checksum('testing crc32 again') == u32(1420327025)
assert c.checksum('testing crc32 again').hex() == '0x54a87871'
}
}

View File

@@ -50,4 +50,4 @@ pub fn (l Log) debug(s string){
f := term.blue('D')
println('[$f]$s')
}
}
}

View File

@@ -44,4 +44,4 @@ pub fn rotate_left_64(x u64, k int) u64 {
n := u64(64)
s := u64(k) & (n - u64(1))
return u64(u64(x<<s) | u64(x>>(n-s)))
}
}

View File

@@ -138,4 +138,4 @@ fn test_gcd_and_reduce(){
mut f := fractions.fraction(3, 9)
assert f.gcd() == 3
assert f.reduce().equals(fractions.fraction(1, 3))
}
}

View File

@@ -128,4 +128,4 @@ pub fn white(msg string) string {
pub fn yellow(msg string) string {
return format(msg, '33', '39')
}
}

View File

@@ -107,4 +107,4 @@ pub fn show_cursor()
pub fn hide_cursor()
{
print('\x1b[?25l')
}
}