mirror of https://github.com/01-edu/public.git
Create diamon_test.js
This commit is contained in:
parent
1e4904a00d
commit
3c37510aa9
|
@ -0,0 +1,193 @@
|
|||
export const tests = []
|
||||
const t = f => tests.push(f)
|
||||
t(({ code }) => code.split('\n').filter(s => s.trim()).length < 78)
|
||||
t(({ code }) => !code.includes('$'))
|
||||
|
||||
t(({ eq }) => eq(diamon('x', 1)), $a.trim())
|
||||
t(({ eq }) => eq(diamon('x', 2)), $b.trim())
|
||||
t(({ eq }) => eq(diamon('x', 3)), $c.trim())
|
||||
t(({ eq }) => eq(diamon('<>', 4)), $d.trim())
|
||||
t(({ eq }) => eq(diamon('#', 40)), $e.trim())
|
||||
t(({ eq }) => eq(diamon('{}', 12)), $f.trim())
|
||||
t(({ eq }) => eq(diamon('ABC', 7)), $g.trim())
|
||||
t(({ eq }) => eq(diamon('<^>', 13)), $h.trim())
|
||||
|
||||
Object.freeze(tests)
|
||||
|
||||
const $a = `x`
|
||||
const $b = `
|
||||
x
|
||||
xxx
|
||||
x
|
||||
`
|
||||
|
||||
const $c = `
|
||||
x
|
||||
xxx
|
||||
xxxxx
|
||||
xxx
|
||||
x
|
||||
`
|
||||
|
||||
const $d = `
|
||||
<>
|
||||
<><><>
|
||||
<><><><><>
|
||||
<><><><><><><>
|
||||
<><><><><>
|
||||
<><><>
|
||||
<>
|
||||
`
|
||||
|
||||
const $e = `
|
||||
|
||||
#
|
||||
###
|
||||
#####
|
||||
#######
|
||||
#########
|
||||
###########
|
||||
#############
|
||||
###############
|
||||
#################
|
||||
###################
|
||||
#####################
|
||||
#######################
|
||||
#########################
|
||||
###########################
|
||||
#############################
|
||||
###############################
|
||||
#################################
|
||||
###################################
|
||||
#####################################
|
||||
#######################################
|
||||
#########################################
|
||||
###########################################
|
||||
#############################################
|
||||
###############################################
|
||||
#################################################
|
||||
###################################################
|
||||
#####################################################
|
||||
#######################################################
|
||||
#########################################################
|
||||
###########################################################
|
||||
#############################################################
|
||||
###############################################################
|
||||
#################################################################
|
||||
###################################################################
|
||||
#####################################################################
|
||||
#######################################################################
|
||||
#########################################################################
|
||||
###########################################################################
|
||||
#############################################################################
|
||||
###############################################################################
|
||||
#############################################################################
|
||||
###########################################################################
|
||||
#########################################################################
|
||||
#######################################################################
|
||||
#####################################################################
|
||||
###################################################################
|
||||
#################################################################
|
||||
###############################################################
|
||||
#############################################################
|
||||
###########################################################
|
||||
#########################################################
|
||||
#######################################################
|
||||
#####################################################
|
||||
###################################################
|
||||
#################################################
|
||||
###############################################
|
||||
#############################################
|
||||
###########################################
|
||||
#########################################
|
||||
#######################################
|
||||
#####################################
|
||||
###################################
|
||||
#################################
|
||||
###############################
|
||||
#############################
|
||||
###########################
|
||||
#########################
|
||||
#######################
|
||||
#####################
|
||||
###################
|
||||
#################
|
||||
###############
|
||||
#############
|
||||
###########
|
||||
#########
|
||||
#######
|
||||
#####
|
||||
###
|
||||
#
|
||||
`
|
||||
|
||||
const $f = `
|
||||
{}
|
||||
{}{}{}
|
||||
{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}{}{}
|
||||
{}{}{}{}{}
|
||||
{}{}{}
|
||||
{}
|
||||
`
|
||||
|
||||
const $g = `
|
||||
ABC
|
||||
ABCABCABC
|
||||
ABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABCABCABC
|
||||
ABCABCABCABCABC
|
||||
ABCABCABC
|
||||
ABC
|
||||
`
|
||||
|
||||
const $h = `
|
||||
<^>
|
||||
<^><^><^>
|
||||
<^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^><^><^>
|
||||
<^><^><^><^><^>
|
||||
<^><^><^>
|
||||
<^>
|
||||
`
|
Loading…
Reference in New Issue