Skip to content

Commit

Permalink
fix strings.Builder.str()
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Nov 17, 2019
1 parent be7cf3e commit 6ae8457
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
run: ./v -o v2 v.v && ./v2 -o v3 v.v
- name: Test v->c
run: ./v test v
- name: Test v->js
run: ./v -o hi.js examples/hello_v_js.v && node hi.js
# - name: Test v->js
# run: ./v -o hi.js examples/hello_v_js.v && node hi.js
- name: Test vid
run: |
git clone --depth 1 https://github.com/vlang/vid.git
Expand Down
6 changes: 2 additions & 4 deletions vlib/compiler/tests/asm_test.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
fn test_inline_asm() {
$if !windows {
$if !tinyc {
a := 10
b := 0
unsafe {
Expand All @@ -18,11 +16,11 @@ fn test_inline_asm() {
e := 0
unsafe {
asm(
//".intel_syntax noprefix;"
//"mov %0, 5"
"movl $5, %0"
:"=a"(e)
)
}
assert e == 5
}
}
}
2 changes: 1 addition & 1 deletion vlib/encoding/csv/writer.v
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ fn (w &Writer) field_needs_quotes(field string) bool {
return false
}

pub fn (w &Writer) str() string {
pub fn (w mut Writer) str() string {
return w.sb.str()
}
3 changes: 2 additions & 1 deletion vlib/strings/builder_c.v
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ pub fn (b mut Builder) writeln(s string) {
b.len += s.len + 1
}

pub fn (b Builder) str() string {
pub fn (b mut Builder) str() string {
b.buf << `\0`
return string(b.buf, b.len)
}

Expand Down

0 comments on commit 6ae8457

Please sign in to comment.