mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: remove module main
from tests, that do not need to be internal
This commit is contained in:
parent
728b4cffc3
commit
94a36c5ca4
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
type ALchar = char
|
type ALchar = char
|
||||||
|
|
||||||
fn test_alias_char_type_reference() {
|
fn test_alias_char_type_reference() {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_anon_fn_with_nested_anon_fn_args() {
|
fn test_anon_fn_with_nested_anon_fn_args() {
|
||||||
mut xa := fn (x fn (int) string, y int) string {
|
mut xa := fn (x fn (int) string, y int) string {
|
||||||
return x(y)
|
return x(y)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn func(arg struct { foo string }) {
|
fn func(arg struct { foo string }) {
|
||||||
assert arg.foo == 'foo'
|
assert arg.foo == 'foo'
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_cast_bool_to_int() {
|
fn test_cast_bool_to_int() {
|
||||||
i := true
|
i := true
|
||||||
x := int(i)
|
x := int(i)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
type CEnum = int
|
type CEnum = int
|
||||||
|
|
||||||
enum Enum {
|
enum Enum {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_cast_to_anon_sumtype() {
|
fn test_cast_to_anon_sumtype() {
|
||||||
x := string|none(none)
|
x := string|none(none)
|
||||||
println(x)
|
println(x)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_cast_to_alias() {
|
fn test_cast_to_alias() {
|
||||||
r1 := u8(u8(1))
|
r1 := u8(u8(1))
|
||||||
println(r1)
|
println(r1)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import datatypes
|
import datatypes
|
||||||
|
|
||||||
struct Item {
|
struct Item {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
// exploring `decode` options with nested structs
|
// exploring `decode` options with nested structs
|
||||||
|
|
||||||
struct Parent {
|
struct Parent {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct S1 {}
|
struct S1 {}
|
||||||
|
|
||||||
fn test_comptime_for_method_call_str() {
|
fn test_comptime_for_method_call_str() {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn write[T](out T) string {
|
fn write[T](out T) string {
|
||||||
$if T.typ is bool {
|
$if T.typ is bool {
|
||||||
println('FOO')
|
println('FOO')
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import term
|
import term
|
||||||
|
|
||||||
fn abc() {
|
fn abc() {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
const iterations = (os.getenv_opt('ITERATIONS') or { '5' }).int()
|
const iterations = (os.getenv_opt('ITERATIONS') or { '5' }).int()
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import rand
|
import rand
|
||||||
import rand.wyrand
|
import rand.wyrand
|
||||||
import rand.splitmix64
|
import rand.splitmix64
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_fixed_array_of_threads() {
|
fn test_fixed_array_of_threads() {
|
||||||
mut avar := [8]thread string{}
|
mut avar := [8]thread string{}
|
||||||
avar[0] = spawn printme()
|
avar[0] = spawn printme()
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
struct Game {
|
struct Game {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
type VkPresentModeKHR = u32
|
type VkPresentModeKHR = u32
|
||||||
|
|
||||||
fn create_c_array[T](len u32) &T {
|
fn create_c_array[T](len u32) &T {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn get_value[T]() ?T {
|
fn get_value[T]() ?T {
|
||||||
return none
|
return none
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Empty {}
|
struct Empty {}
|
||||||
|
|
||||||
struct Node[T] {
|
struct Node[T] {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct None {}
|
struct None {}
|
||||||
|
|
||||||
pub type Maybe[T] = None | T
|
pub type Maybe[T] = None | T
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
interface TypeFactory[T] {
|
interface TypeFactory[T] {
|
||||||
get_type(type_name string) T
|
get_type(type_name string) T
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Container[T] {
|
struct Container[T] {
|
||||||
value T
|
value T
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_generics_method_with_sumtype_args() {
|
fn test_generics_method_with_sumtype_args() {
|
||||||
mut me := CatDad{}
|
mut me := CatDad{}
|
||||||
ret := me.adopt[CatType, Cat](CatType.black, BlackCat{})
|
ret := me.adopt[CatType, Cat](CatType.black, BlackCat{})
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct None {}
|
struct None {}
|
||||||
|
|
||||||
type OptError = None | string
|
type OptError = None | string
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub struct Person {
|
pub struct Person {
|
||||||
pub mut:
|
pub mut:
|
||||||
id int
|
id int
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub struct Maybe[T] {
|
pub struct Maybe[T] {
|
||||||
present bool
|
present bool
|
||||||
val T
|
val T
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub struct Randomizer[T] {
|
pub struct Randomizer[T] {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub struct Reptile {}
|
pub struct Reptile {}
|
||||||
|
|
||||||
pub struct Insect {}
|
pub struct Insect {}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub struct Vec[T] {
|
pub struct Vec[T] {
|
||||||
mut:
|
mut:
|
||||||
data &T
|
data &T
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn foo[T](val T) ?T {
|
fn foo[T](val T) ?T {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_go_call_fn_using_map_value() {
|
fn test_go_call_fn_using_map_value() {
|
||||||
sum := fn (x int, y int) int {
|
sum := fn (x int, y int) int {
|
||||||
return x + y
|
return x + y
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import rand
|
import rand
|
||||||
|
|
||||||
interface Sample {
|
interface Sample {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
type ConfigValue = bool | int | string
|
type ConfigValue = bool | int | string
|
||||||
type ConfigMap = map[string]ConfigValue
|
type ConfigMap = map[string]ConfigValue
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import geometry { Line, Point, PointCond, Shape, point_str }
|
import geometry { Line, Point, PointCond, Shape, point_str }
|
||||||
|
|
||||||
fn point_is(p Point, cond PointCond) bool {
|
fn point_is(p Point, cond PointCond) bool {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_interface_embedding_call() {
|
fn test_interface_embedding_call() {
|
||||||
g1 := G1{}
|
g1 := G1{}
|
||||||
do_the_greet(g1)
|
do_the_greet(g1)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub interface IObject {
|
pub interface IObject {
|
||||||
mut:
|
mut:
|
||||||
do_stuff()
|
do_stuff()
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
interface Getter {
|
interface Getter {
|
||||||
get() string
|
get() string
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
interface Speaker {
|
interface Speaker {
|
||||||
say() string
|
say() string
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_mark_as_referenced() {
|
fn test_mark_as_referenced() {
|
||||||
if true {
|
if true {
|
||||||
a := Type{}
|
a := Type{}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
type Sum = Struct | int
|
type Sum = Struct | int
|
||||||
|
|
||||||
struct Struct {
|
struct Struct {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn has_optional() ?int {
|
fn has_optional() ?int {
|
||||||
return 51
|
return 51
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
type Abc = int | rune | string | u32
|
type Abc = int | rune | string | u32
|
||||||
|
|
||||||
fn cyz() (Abc, string) {
|
fn cyz() (Abc, string) {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
struct Alarms {
|
struct Alarms {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_shared_array_last() {
|
fn test_shared_array_last() {
|
||||||
shared a := []int{}
|
shared a := []int{}
|
||||||
lock {
|
lock {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
struct Alarms {
|
struct Alarms {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct ABC {
|
struct ABC {
|
||||||
mut:
|
mut:
|
||||||
s string
|
s string
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Aa {
|
struct Aa {
|
||||||
mut:
|
mut:
|
||||||
b []int
|
b []int
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
[heap]
|
[heap]
|
||||||
pub struct Grid {
|
pub struct Grid {
|
||||||
pub mut:
|
pub mut:
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Anything {
|
struct Anything {
|
||||||
mut:
|
mut:
|
||||||
name string
|
name string
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Person {
|
struct Person {
|
||||||
name string
|
name string
|
||||||
age int
|
age int
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Animal {
|
struct Animal {
|
||||||
Duck
|
Duck
|
||||||
id int
|
id int
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct Author {
|
struct Author {
|
||||||
username string
|
username string
|
||||||
name string
|
name string
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
interface Greeting {
|
interface Greeting {
|
||||||
tt ?string
|
tt ?string
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn string_none() string|none {
|
fn string_none() string|none {
|
||||||
return none
|
return none
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
struct PlotData {
|
struct PlotData {
|
||||||
dates []string
|
dates []string
|
||||||
numerical_result []int
|
numerical_result []int
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
pub struct SomeThing {
|
pub struct SomeThing {
|
||||||
pub:
|
pub:
|
||||||
m map[string]string
|
m map[string]string
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_typeof_fn() {
|
fn test_typeof_fn() {
|
||||||
assert typeof[fn (s string, x u32) (int, f32)]().name == 'fn (string, u32) (int, f32)'
|
assert typeof[fn (s string, x u32) (int, f32)]().name == 'fn (string, u32) (int, f32)'
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
fn test_autoprint_string_vargs() {
|
fn test_autoprint_string_vargs() {
|
||||||
add_s('a')
|
add_s('a')
|
||||||
assert true
|
assert true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user